File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public void initialize(PythonCore core) {
104104 builtinConstants .put ("byteorder" , ByteOrder .nativeOrder () == ByteOrder .LITTLE_ENDIAN ? "little" : "big" );
105105 builtinConstants .put ("copyright" , LICENSE );
106106 builtinConstants .put ("dont_write_bytecode" , true );
107- if (TruffleOptions .AOT ) {
107+ if (TruffleOptions .AOT || ! core . getContext (). isExecutableAccessAllowed () ) {
108108 // cannot set the path at this time since the binary is not yet known; will be patched
109109 // in the context
110110 builtinConstants .put ("executable" , PNone .NONE );
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public void patch(Env newEnv) {
192192
193193 private void setupRuntimeInformation () {
194194 PythonModule sysModule = core .initializeSysModule ();
195- if (TruffleOptions .AOT && !language .isNativeBuildTime ()) {
195+ if (TruffleOptions .AOT && !language .isNativeBuildTime () && isExecutableAccessAllowed () ) {
196196 sysModule .setAttribute ("executable" , ProcessProperties .getExecutableName ());
197197 }
198198 sysModules = (PDict ) sysModule .getAttribute ("modules" );
@@ -260,4 +260,8 @@ public void initializeMainModule(String path) {
260260 public static Assumption getSingleNativeContextAssumption () {
261261 return singleNativeContext ;
262262 }
263+
264+ public boolean isExecutableAccessAllowed () {
265+ return getEnv ().isHostLookupAllowed () || getEnv ().isNativeAccessAllowed ();
266+ }
263267}
You can’t perform that action at this time.
0 commit comments