Skip to content

Commit 698cf9f

Browse files
committed
fix small bug, add tests for os.pathsep
1 parent 3e9d8be commit 698cf9f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

os/os.module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func getname() py.String {
3636

3737
// getpathsep returns the seperator used in $PATH. This is ';' for windows and ':' for posix
3838
func getpathsep() py.String {
39-
if runtime.GOOS != "windows" {
39+
if runtime.GOOS == "windows" {
4040
return py.String(";")
4141
}
4242
return py.String(":")

os/os.test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ def _fail(test_name):
178178
_fail("os.sep corresponding with os.name")
179179
failed+=1
180180

181+
if os.pathsep == ":" and os.name == "posix":
182+
_pass('os.pathsep == ":" and os.name == "posix"')
183+
passed_tests+=1
184+
elif os.pathsep == ";" and os.name == "nt":
185+
_pass('os.pathsep == ";" and os.name == "nt"')
186+
passed_tests+=1
187+
else:
188+
_fail("os.pathsep corresponding with os.name")
189+
failed+=1
190+
181191
print()
182192
print(bcolors.ENDC+bcolors.BOLD+bcolors.HEADER+"Please check if $HOME will be outputted...")
183193
print(bcolors.ENDC)

0 commit comments

Comments
 (0)