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

index 5027d4eeb801a86c3a0501e4e2064e8cdd9e36db..72c962efaeb841831e39313e2b47a6061aee322a 100755 (executable)
@@ -120,15 +120,15 @@ def doDiff(OUTFILE, OUTDIR, REFDIR, testname, subtest_index, fmt):
       stdout=subprocess.DEVNULL,
     )
   elif F == 'svg':
-    with open(TMPFILE1, mode='w') as fd1, \
-         open(TMPFILE2, mode='w') as fd2:
+    with open(TMPFILE1, mode='w') as fd:
       subprocess.check_call(
         ['sed', '/^<!--/d;/-->$/d', FILE1],
-        stdout=fd1,
+        stdout=fd,
       )
+    with open(TMPFILE2, mode='w') as fd:
       subprocess.check_call(
         ['sed', '/^<!--/d;/-->$/d', FILE2],
-        stdout=fd2,
+        stdout=fd,
       )
     returncode = subprocess.call(
       ['diff', '-q', '--strip-trailing-cr', TMPFILE1, TMPFILE2],