File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 97
97
import com .oracle .truffle .api .profiles .ConditionProfile ;
98
98
import com .oracle .truffle .llvm .api .Toolchain ;
99
99
100
+ import org .graalvm .nativeimage .ImageInfo ;
101
+
100
102
@ CoreFunctions (defineModule = "sys" )
101
103
public class SysModuleBuiltins extends PythonBuiltins {
102
104
public static final String LLVM_LANGUAGE = "llvm" ;
@@ -190,7 +192,9 @@ public void postInitialize(PythonCore core) {
190
192
String stdlibHome = context .getStdlibHome ();
191
193
String capiHome = context .getCAPIHome ();
192
194
193
- sys .setAttribute ("executable" , PythonOptions .getOption (context , PythonOptions .Executable ));
195
+ if (!ImageInfo .inImageBuildtimeCode ()) {
196
+ sys .setAttribute ("executable" , PythonOptions .getOption (context , PythonOptions .Executable ));
197
+ }
194
198
sys .setAttribute ("graal_python_jython_emulation_enabled" , PythonOptions .getOption (context , PythonOptions .EmulateJython ));
195
199
sys .setAttribute ("graal_python_host_import_enabled" , context .getEnv ().isHostLookupAllowed ());
196
200
sys .setAttribute ("graal_python_home" , context .getLanguage ().getHome ());
You can’t perform that action at this time.
0 commit comments