]> granicus.if.org Git - graphviz/commitdiff
unfuse a with block in rtest
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 19:40:03 +0000 (12:40 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 02:15:43 +0000 (19:15 -0700)
rtest/rtest.py

index c44cdc3339c76b65e2d2fda6a92dab2b433e70e6..5027d4eeb801a86c3a0501e4e2064e8cdd9e36db 100755 (executable)
@@ -105,15 +105,15 @@ def doDiff(OUTFILE, OUTDIR, REFDIR, testname, subtest_index, fmt):
   FILE2 = os.path.join(REFDIR, OUTFILE)
   F = fmt.split(':')[0]
   if F in ['ps', 'ps2']:
-    with open(TMPFILE1, mode='w') as fd1, \
-         open(TMPFILE2, mode='w') as fd2:
+    with open(TMPFILE1, mode='w') as fd:
       subprocess.check_call(
         ['awk', '-f', 'strps.awk', FILE1],
-        stdout=fd1,
+        stdout=fd,
       )
+    with open(TMPFILE2, mode='w') as fd:
       subprocess.check_call(
         ['awk', '-f', 'strps.awk', FILE2],
-        stdout=fd2,
+        stdout=fd,
       )
     returncode = subprocess.call(
       ['diff', '-q', TMPFILE1, TMPFILE2],