summaryrefslogtreecommitdiffstats
path: root/test/Interactive
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-04-01 23:40:42 (GMT)
committerMats Wichmann <mats@linux.com>2019-04-01 23:40:42 (GMT)
commit11355c20e8779a644f6eb51a9cbf80557c3e905c (patch)
treedc1002c9363c98fb174c5853df2962f033f62a18 /test/Interactive
parentc7fedae70b112c03f8898e4b3091770a07b46f2c (diff)
downloadSCons-11355c20e8779a644f6eb51a9cbf80557c3e905c.zip
SCons-11355c20e8779a644f6eb51a9cbf80557c3e905c.tar.gz
SCons-11355c20e8779a644f6eb51a9cbf80557c3e905c.tar.bz2
[PR #3339] Updates for that failed
Since the build with everything-CI-j2 triggered a couple of test fails, include the patches for open-file warnings in those test areas in the hopes it will help. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/Interactive')
-rw-r--r--test/Interactive/configure.py7
-rw-r--r--test/Interactive/option-j.py16
2 files changed, 11 insertions, 12 deletions
diff --git a/test/Interactive/configure.py b/test/Interactive/configure.py
index 906a7e9..a7f0735 100644
--- a/test/Interactive/configure.py
+++ b/test/Interactive/configure.py
@@ -38,10 +38,9 @@ test = TestSCons.TestSCons()
test.write('mycc.py', r"""
import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l[:7] != '/*c++*/']:
- outfile.write(l)
+with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp:
+ for l in [l for l in ifp.readlines() if l[:7] != '/*c++*/']:
+ ofp.write(l)
sys.exit(0)
""")
diff --git a/test/Interactive/option-j.py b/test/Interactive/option-j.py
index 279fc51..356a067 100644
--- a/test/Interactive/option-j.py
+++ b/test/Interactive/option-j.py
@@ -39,10 +39,10 @@ from SCons.Script import *
def cat(target, source, env):
t = str(target[0])
os.mkdir(t + '.started')
- fp = open(t, 'wb')
- for s in source:
- fp.write(open(str(s), 'rb').read())
- fp.close()
+ with open(t, 'wb') as ofp:
+ for s in source:
+ with open(str(s), 'rb') as ifp:
+ ofp.write(ifp.read())
os.mkdir(t + '.finished')
def must_be_finished(target, source, env, dir):
@@ -63,10 +63,10 @@ def must_wait_for_f2_b_out(target, source, env):
f2_b_started = 'f2-b.out.started'
while not os.path.exists(f2_b_started):
time.sleep(1)
- fp = open(t, 'wb')
- for s in source:
- fp.write(open(str(s), 'rb').read())
- fp.close()
+ with open(t, 'wb') as ofp:
+ for s in source:
+ with open(str(s), 'rb') as ifp:
+ ofp.write(ifp.read())
os.mkdir(t + '.finished')
def _f2_a_out_must_not_be_finished(target, source, env):