Skip to content

Commit 0eddd13

Browse files
committed
Fix unsupported use of sys.executable
Fixes #308
1 parent 4da9540 commit 0eddd13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ int forkExec(VirtualFrame frame, Object[] args, Object executableList, boolean c
268268
for (int i = 0; i < length; ++i) {
269269
byte[] bytes = toBytesNode.execute(frame, getItem.execute(frame, executableList, i));
270270
if (Arrays.equals(bytes, sysExecutable)) {
271-
if (length != 1) {
271+
TruffleString[] additionalArgs = PythonOptions.getExecutableList(getContext());
272+
if (length != 1 && additionalArgs.length != 1) {
272273
throw raise(ValueError, ErrorMessages.UNSUPPORTED_USE_OF_SYS_EXECUTABLE);
273274
}
274-
TruffleString[] additionalArgs = PythonOptions.getExecutableList(getContext());
275275
Object[] extendedArgs = new Object[additionalArgs.length + (processArgs.length == 0 ? 0 : processArgs.length - 1)];
276276
for (int j = 0; j < additionalArgs.length; ++j) {
277277
extendedArgs[j] = createPathFromBytes(fsEncode(additionalArgs[j].toJavaStringUncached()), posixLib);

0 commit comments

Comments
 (0)