Skip to content

Commit aae53af

Browse files
committed
Fix Py2BinLauncher for Windows
1 parent f361f88 commit aae53af

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graalpython/lib-graalpython/modules/standalone/templates/Py2BinLauncher.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ public class Py2BinLauncher {
8484
private static final String PROJ_PREFIX = "/{vfs-proj-prefix}";
8585

8686
public static void main(String[] args) throws IOException {
87+
VirtualFileSystem vfs = new VirtualFileSystem();
8788
var builder = Context.newBuilder()
8889
.allowExperimentalOptions(true)
8990
.allowAllAccess(true)
9091
.allowIO(true)
91-
.fileSystem(new VirtualFileSystem())
92+
.fileSystem(vfs)
9293
.option("python.PosixModuleBackend", "java")
9394
.option("python.NativeModules", "")
9495
.option("python.DontWriteBytecodeFlag", "true")
@@ -98,9 +99,9 @@ public static void main(String[] args) throws IOException {
9899
.option("python.AlwaysRunExcepthook", "true")
99100
.option("python.ForceImportSite", "true")
100101
.option("python.RunViaLauncher", "true")
101-
.option("python.Executable", VENV_PREFIX + "/bin/python")
102-
.option("python.InputFilePath", PROJ_PREFIX)
103-
.option("python.PythonHome", HOME_PREFIX)
102+
.option("python.Executable", vfs.resourcePathToPlatformPath(VENV_PREFIX) + (VirtualFileSystem.isWindows() ? "\\Scripts\\python.cmd" : "/bin/python"))
103+
.option("python.InputFilePath", vfs.resourcePathToPlatformPath(PROJ_PREFIX))
104+
.option("python.PythonHome", vfs.resourcePathToPlatformPath(HOME_PREFIX))
104105
.option("python.CheckHashPycsMode", "never");
105106
if(ImageInfo.inImageRuntimeCode()) {
106107
builder.option("engine.WarnInterpreterOnly", "false");

0 commit comments

Comments
 (0)