Skip to content

Commit 46ea17b

Browse files
committed
fix -CC and -LD invocation
1 parent da4ebf2 commit 46ea17b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
146146
break;
147147
case "-CC":
148148
if (wantsExperimental) {
149-
if (i != defaultEnvironmentArgs.size()) {
149+
if (i != defaultEnvironmentArgs.size() + 1) {
150+
// +1 because we need the --experimental-options
150151
throw new IllegalArgumentException("-CC must be the first given argument");
151152
}
152153
GraalPythonCC.main(arguments.subList(i + 1, arguments.size()).toArray(new String[0]));
@@ -155,7 +156,8 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
155156
}
156157
case "-LD":
157158
if (wantsExperimental) {
158-
if (i != defaultEnvironmentArgs.size()) {
159+
if (i != defaultEnvironmentArgs.size() + 1) {
160+
// +1 because we need the --experimental-options
159161
throw new IllegalArgumentException("-LD must be the first given argument");
160162
}
161163
GraalPythonLD.main(arguments.subList(i + 1, arguments.size()).toArray(new String[0]));

0 commit comments

Comments
 (0)