From: Matthew Fernandez Date: Sat, 24 Oct 2020 19:40:03 +0000 (-0700) Subject: unfuse a with block in rtest X-Git-Tag: 2.46.0~20^2^2~3^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eda34952debb071d602ca9da9534fde00e76e2f0;p=graphviz unfuse a with block in rtest --- diff --git a/rtest/rtest.py b/rtest/rtest.py index c44cdc333..5027d4eeb 100755 --- a/rtest/rtest.py +++ b/rtest/rtest.py @@ -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],