Skip to content

Commit 0c7483a

Browse files
Kartik Rajkarthiknadig
Kartik Raj
authored andcommitted
Fix marker script support for '-c' flag (#18418)
1 parent 062a6a3 commit 0c7483a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pythonFiles/get_output_via_markers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
try:
1414
if module == "-c":
1515
ns = {}
16-
for code in sys.argv[2:]:
17-
exec(code, ns, ns)
16+
code = sys.argv[2]
17+
del sys.argv[2]
18+
del sys.argv[0]
19+
exec(code, ns, ns)
1820
elif module.startswith("-m"):
1921
moduleName = sys.argv[2]
2022
sys.argv = sys.argv[2:] # It should begin with the module name.

0 commit comments

Comments
 (0)