Skip to content

Commit cd93309

Browse files
committed
do not quote everything in the single sys.executable
1 parent b86eaf9 commit cd93309

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ private static String getExecutable() {
296296
} else if (ImageInfo.inImageBuildtimeCode()) {
297297
return "";
298298
} else {
299-
// we quote all arguments here, because using sys.executable directly will only work on
300-
// a shell, anyways.
301299
String[] executableList = getExecutableList();
302300
for (int i = 0; i < executableList.length; i++) {
303-
executableList[i] = executableList[i].replace("'", "\\'");
301+
if (executableList[i].matches("\\s")) {
302+
executableList[i] = "'" + executableList[i].replace("'", "\\'") + "'";
303+
}
304304
}
305-
return "'" + String.join("' '", executableList) + "'";
305+
return String.join(" ", executableList);
306306
}
307307
}
308308

0 commit comments

Comments
 (0)