fix for windows

This commit is contained in:
2023-07-12 00:43:18 +01:00
parent 4d37d8d4de
commit 32f810e9b0
3 changed files with 6 additions and 5 deletions

View File

@@ -63,7 +63,7 @@ func importMod(realpath string, origin string, main bool, global ArObject) (ArOb
if err != nil {
return ArObject{}, ArErr{TYPE: "Import Error", message: "Could not get executable", EXISTS: true}
}
executable := filepath.Dir(exc)
executable := filepath.Dir(filepath.ToSlash(exc))
isABS := filepath.IsAbs(path)
var pathsToTest []string
if isABS {
@@ -127,7 +127,7 @@ func importMod(realpath string, origin string, main bool, global ArObject) (ArOb
if _, ok := args[0].(string); !ok {
return nil, ArErr{"Import Error", "Invalid argument type", 0, realpath, "", true}
}
return importMod(args[0].(string), filepath.Dir(p), false, global)
return importMod(args[0].(string), filepath.Dir(filepath.ToSlash(p)), false, global)
}},
"cwd": ex,
"exc": exc,