summaryrefslogtreecommitdiffstats
path: root/test/MSVC/batch.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-04-28 19:43:43 (GMT)
committerGitHub <noreply@github.com>2019-04-28 19:43:43 (GMT)
commit35e6bbe16a859b42efca4592b435695a530f0717 (patch)
tree5a298b113bb1899e91583866b41eb9c337c0857e /test/MSVC/batch.py
parent44c7b81e1a47ff5d4439740b1e929ea723ee1f18 (diff)
parent4ecdcf07580b1bfcd03f7886b6ab9256ee825175 (diff)
downloadSCons-35e6bbe16a859b42efca4592b435695a530f0717.zip
SCons-35e6bbe16a859b42efca4592b435695a530f0717.tar.gz
SCons-35e6bbe16a859b42efca4592b435695a530f0717.tar.bz2
Merge pull request #3345 from mwichmann/py38warns4-tests
[wip] Py38warns4 tests
Diffstat (limited to 'test/MSVC/batch.py')
-rw-r--r--test/MSVC/batch.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/MSVC/batch.py b/test/MSVC/batch.py
index 0d3063f..d9033ec 100644
--- a/test/MSVC/batch.py
+++ b/test/MSVC/batch.py
@@ -56,20 +56,24 @@ else:
# Delay writing the .log output until here so any trailing slash or
# backslash has been stripped, and the output comparisons later in this
# script don't have to account for the difference.
-open('fake_cl.log', 'a').write(" ".join(sys.argv[1:]) + '\\n')
+with open('fake_cl.log', 'a') as ofp:
+ ofp.write(" ".join(sys.argv[1:]) + '\\n')
for infile in input_files:
if dir:
outfile = os.path.join(dir, infile.replace('.c', '.obj'))
else:
outfile = output
- open(outfile, 'w').write(open(infile, 'r').read())
+ with open(outfile, 'w') as ofp:
+ with open(infile, 'r') as ifp:
+ ofp.write(ifp.read())
""")
test.write('fake_link.py', """\
import sys
-ofp = open(sys.argv[1], 'w')
-for infile in sys.argv[2:]:
- ofp.write(open(infile, 'r').read())
+with open(sys.argv[1], 'w') as ofp:
+ for infile in sys.argv[2:]:
+ with open(infile, 'r') as ifp:
+ ofp.write(ifp.read())
""")
test.write('SConstruct', """