Skip to content

Commit b4b3a53

Browse files
committed
Don't remove relaunch args from orig_argv
1 parent d6fbfa2 commit b4b3a53

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,6 @@ protected void launch(Builder contextBuilder) {
762762
}
763763
}
764764

765-
if (relaunchArgs != null) {
766-
Iterator<String> it = origArgs.iterator();
767-
while (it.hasNext()) {
768-
if (relaunchArgs.contains(it.next())) {
769-
it.remove();
770-
}
771-
}
772-
}
773765
origArgs.add(0, toAbsolutePath(executable));
774766
contextBuilder.option("python.OrigArgv", String.join(STRING_LIST_DELIMITER, origArgs));
775767

graalpython/lib-python/3/test/test_sys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,8 @@ def test_orig_argv(self):
12001200
code = textwrap.dedent('''
12011201
import sys
12021202
print(sys.argv)
1203-
print(sys.orig_argv)
1203+
# GraalPy change: remove options implicitly passed down by our posix module magic
1204+
print([arg for arg in sys.orig_argv if not arg.startswith(('--experimental-options', '--vm.', '--python.'))])
12041205
''')
12051206
args = [sys.executable, '-I', '-X', 'utf8', '-c', code, 'arg']
12061207
proc = subprocess.run(args, check=True, capture_output=True, text=True, env=env)

0 commit comments

Comments
 (0)