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) {
104
104
builtinConstants .put ("byteorder" , ByteOrder .nativeOrder () == ByteOrder .LITTLE_ENDIAN ? "little" : "big" );
105
105
builtinConstants .put ("copyright" , LICENSE );
106
106
builtinConstants .put ("dont_write_bytecode" , true );
107
- if (TruffleOptions .AOT ) {
107
+ if (TruffleOptions .AOT || ! core . getContext (). isExecutableAccessAllowed () ) {
108
108
// cannot set the path at this time since the binary is not yet known; will be patched
109
109
// in the context
110
110
builtinConstants .put ("executable" , PNone .NONE );
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public void patch(Env newEnv) {
192
192
193
193
private void setupRuntimeInformation () {
194
194
PythonModule sysModule = core .initializeSysModule ();
195
- if (TruffleOptions .AOT && !language .isNativeBuildTime ()) {
195
+ if (TruffleOptions .AOT && !language .isNativeBuildTime () && isExecutableAccessAllowed () ) {
196
196
sysModule .setAttribute ("executable" , ProcessProperties .getExecutableName ());
197
197
}
198
198
sysModules = (PDict ) sysModule .getAttribute ("modules" );
@@ -260,4 +260,8 @@ public void initializeMainModule(String path) {
260
260
public static Assumption getSingleNativeContextAssumption () {
261
261
return singleNativeContext ;
262
262
}
263
+
264
+ public boolean isExecutableAccessAllowed () {
265
+ return getEnv ().isHostLookupAllowed () || getEnv ().isNativeAccessAllowed ();
266
+ }
263
267
}
You can’t perform that action at this time.
0 commit comments