Skip to content

Commit a75e763

Browse files
committed
Add os.sep
1 parent 615a121 commit a75e763

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Lib/os.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
from _os import *
22

3+
if name == 'nt':
4+
sep = '\\'
5+
else:
6+
sep = '/'
7+
38
# Change environ to automatically call putenv(), unsetenv if they exist.
49
from _collections_abc import MutableMapping
510

tests/snippets/stdlib_os.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ def __exit__(self, exc_type, exc_val, exc_tb):
5858
os.putenv(ENV_KEY, ENV_VALUE)
5959
os.unsetenv(ENV_KEY)
6060
assert os.getenv(ENV_KEY) == None
61+
62+
if os.name == "nt":
63+
assert os.sep == "\\"
64+
else:
65+
assert os.sep == "/"

0 commit comments

Comments
 (0)