Skip to content

Commit 5a18f9b

Browse files
committed
don't store the executable path in the prebuilt image
1 parent 973e65e commit 5a18f9b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
import com.oracle.truffle.api.profiles.ConditionProfile;
9898
import com.oracle.truffle.llvm.api.Toolchain;
9999

100+
import org.graalvm.nativeimage.ImageInfo;
101+
100102
@CoreFunctions(defineModule = "sys")
101103
public class SysModuleBuiltins extends PythonBuiltins {
102104
public static final String LLVM_LANGUAGE = "llvm";
@@ -190,7 +192,9 @@ public void postInitialize(PythonCore core) {
190192
String stdlibHome = context.getStdlibHome();
191193
String capiHome = context.getCAPIHome();
192194

193-
sys.setAttribute("executable", PythonOptions.getOption(context, PythonOptions.Executable));
195+
if (!ImageInfo.inImageBuildtimeCode()) {
196+
sys.setAttribute("executable", PythonOptions.getOption(context, PythonOptions.Executable));
197+
}
194198
sys.setAttribute("graal_python_jython_emulation_enabled", PythonOptions.getOption(context, PythonOptions.EmulateJython));
195199
sys.setAttribute("graal_python_host_import_enabled", context.getEnv().isHostLookupAllowed());
196200
sys.setAttribute("graal_python_home", context.getLanguage().getHome());

0 commit comments

Comments
 (0)