]> granicus.if.org Git - graphviz/commitdiff
run_c: [nfc] factor out an array addition
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 20:59:54 +0000 (12:59 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 20:59:54 +0000 (12:59 -0800)
This will make an upcoming commit clearer and more concise.

rtest/gvtest.py

index 383cb827553652b8c950a8a23b0fb8d1ee5a2c34..e91153b11be06ae3de13938ca1b4952d437c9483 100644 (file)
@@ -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