Content-Length: 285484 | pFad | http://github.com/go-python/gpython/commit/#start-of-content

6860EB48 py: fix import on Windows · go-python/gpython@53b7b8e · GitHub
Skip to content

Commit 53b7b8e

Browse files
aiskncw
authored andcommitted
py: fix import on Windows
1 parent cff1e72 commit 53b7b8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

py/import.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package py
88

99
import (
10-
"path"
10+
"path/filepath"
1111
"strings"
1212
)
1313

@@ -101,14 +101,14 @@ func ImportModuleLevelObject(ctx Context, name string, globals, locals StringDic
101101

102102
// Convert import's dot separators into path seps
103103
parts := strings.Split(name, ".")
104-
srcPathname := path.Join(parts...)
104+
srcPathname := filepath.Join(parts...)
105105

106106
opts := CompileOpts{
107107
UseSysPaths: true,
108108
}
109109

110110
if fromFile, ok := globals["__file__"]; ok {
111-
opts.CurDir = path.Dir(string(fromFile.(String)))
111+
opts.CurDir = filepath.Dir(string(fromFile.(String)))
112112
}
113113

114114
module, err := RunFile(ctx, srcPathname, opts, name)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/go-python/gpython/commit/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy