From: Matthew Fernandez Date: Sat, 15 Jan 2022 20:59:54 +0000 (-0800) Subject: run_c: [nfc] factor out an array addition X-Git-Tag: 3.0.0~67^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ae00c7fb24016fe92fc7484bfadde0009cfe831;p=graphviz run_c: [nfc] factor out an array addition This will make an upcoming commit clearer and more concise. --- diff --git a/rtest/gvtest.py b/rtest/gvtest.py index 383cb8275..e91153b11 100644 --- a/rtest/gvtest.py +++ b/rtest/gvtest.py @@ -115,10 +115,11 @@ def run_c(src: Path, args: List[str] = None, input: str = "", compile_c(src, cflags, link, exe) # dump the command being run for the user to observe if the test fails - print(f'+ {exe} {" ".join(str(x) for x in args)}') + argv = [exe] + args + print(f'+ {" ".join(str(x) for x in argv)}') # run it - p = subprocess.run([exe] + args, input=input, stdout=subprocess.PIPE, + p = subprocess.run(argv, input=input, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # check it succeeded