@@ -84,11 +84,12 @@ public class Py2BinLauncher {
84
84
private static final String PROJ_PREFIX = "/{vfs-proj-prefix}" ;
85
85
86
86
public static void main (String [] args ) throws IOException {
87
+ VirtualFileSystem vfs = new VirtualFileSystem ();
87
88
var builder = Context .newBuilder ()
88
89
.allowExperimentalOptions (true )
89
90
.allowAllAccess (true )
90
91
.allowIO (true )
91
- .fileSystem (new VirtualFileSystem () )
92
+ .fileSystem (vfs )
92
93
.option ("python.PosixModuleBackend" , "java" )
93
94
.option ("python.NativeModules" , "" )
94
95
.option ("python.DontWriteBytecodeFlag" , "true" )
@@ -98,9 +99,9 @@ public static void main(String[] args) throws IOException {
98
99
.option ("python.AlwaysRunExcepthook" , "true" )
99
100
.option ("python.ForceImportSite" , "true" )
100
101
.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 ) )
104
105
.option ("python.CheckHashPycsMode" , "never" );
105
106
if (ImageInfo .inImageRuntimeCode ()) {
106
107
builder .option ("engine.WarnInterpreterOnly" , "false" );
0 commit comments