From db36b42f46328a52c76b9618e3ebdfa00c17f651 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sat, 28 Jun 2025 18:11:55 +0900 Subject: [PATCH] py: fix import on Windows --- py/import.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py/import.go b/py/import.go index 709a4468..5ca6598a 100644 --- a/py/import.go +++ b/py/import.go @@ -7,7 +7,7 @@ package py import ( - "path" + "path/filepath" "strings" ) @@ -101,14 +101,14 @@ func ImportModuleLevelObject(ctx Context, name string, globals, locals StringDic // Convert import's dot separators into path seps parts := strings.Split(name, ".") - srcPathname := path.Join(parts...) + srcPathname := filepath.Join(parts...) opts := CompileOpts{ UseSysPaths: true, } if fromFile, ok := globals["__file__"]; ok { - opts.CurDir = path.Dir(string(fromFile.(String))) + opts.CurDir = filepath.Dir(string(fromFile.(String))) } module, err := RunFile(ctx, srcPathname, opts, name)