From 86490814f48f596a216a86ad834f334d0b68675c Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 3 Feb 2022 01:03:38 +0530 Subject: [PATCH] Fix marker script support for '-c' flag --- pythonFiles/get_output_via_markers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pythonFiles/get_output_via_markers.py b/pythonFiles/get_output_via_markers.py index 87be5981b38e..00dd57065b3c 100644 --- a/pythonFiles/get_output_via_markers.py +++ b/pythonFiles/get_output_via_markers.py @@ -13,8 +13,10 @@ try: if module == "-c": ns = {} - for code in sys.argv[2:]: - exec(code, ns, ns) + code = sys.argv[2] + del sys.argv[2] + del sys.argv[0] + exec(code, ns, ns) elif module.startswith("-m"): moduleName = sys.argv[2] sys.argv = sys.argv[2:] # It should begin with the module name.