Skip to content

Commit 3e9d8be

Browse files
committed
add os.pathsep
1 parent 60d81e4 commit 3e9d8be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

os/os.module.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ func getname() py.String {
3434
return py.String("posix")
3535
}
3636

37+
// getpathsep returns the seperator used in $PATH. This is ';' for windows and ':' for posix
38+
func getpathsep() py.String {
39+
if runtime.GOOS != "windows" {
40+
return py.String(";")
41+
}
42+
return py.String(":")
43+
}
44+
3745
func init() {
3846
methods := []*py.Method{
3947
py.MustNewMethod("getcwd", getCwd, 0, "Get the current working directory"),
@@ -55,6 +63,7 @@ func init() {
5563
"pardir": py.String(".."),
5664
"extsep": py.String("."),
5765
"altsep": py.None,
66+
"pathsep": getpathsep(),
5867
}
5968

6069
py.RegisterModule(&py.ModuleImpl{

0 commit comments

Comments
 (0)