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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy