summaryrefslogtreecommitdiff
path: root/test/subdivide.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-03-31 07:01:00 -0600
committerMats Wichmann <mats@linux.com>2019-04-25 09:37:04 -0600
commitf61d3bcd112285644c1a6ce253b267ef690a7e06 (patch)
tree2e489e238c11697f602cb9a7cbeb43afed088734 /test/subdivide.py
parentb0c3385604ebc1d7d552472f1cc6d0910aafa32a (diff)
downloadscons-git-f61d3bcd112285644c1a6ce253b267ef690a7e06.tar.gz
[PY 3.8] test fixes for file closings, rawstrings
On a linux host (missing some things that may be on the Travis CI setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/subdivide.py')
-rw-r--r--test/subdivide.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/subdivide.py b/test/subdivide.py
index 7ddc2e90a..a4a128e83 100644
--- a/test/subdivide.py
+++ b/test/subdivide.py
@@ -59,18 +59,20 @@ fake_link_py = test.workpath('fake_link.py')
test.write(fake_cc_py, """\
import sys
-ofp = open(sys.argv[1], 'w')
-ofp.write('fake_cc.py: %s\\n' % sys.argv)
-for s in sys.argv[2:]:
- ofp.write(open(s, 'r').read())
+with open(sys.argv[1], 'w') as ofp:
+ ofp.write('fake_cc.py: %s\\n' % sys.argv)
+ for s in sys.argv[2:]:
+ with open(s, 'r') as ifp:
+ ofp.write(ifp.read())
""")
test.write(fake_link_py, """\
import sys
-ofp = open(sys.argv[1], 'w')
-ofp.write('fake_link.py: %s\\n' % sys.argv)
-for s in sys.argv[2:]:
- ofp.write(open(s, 'r').read())
+with open(sys.argv[1], 'w') as ofp:
+ ofp.write('fake_link.py: %s\\n' % sys.argv)
+ for s in sys.argv[2:]:
+ with open(s, 'r') as ifp:
+ ofp.write(ifp.read())
""")
test.chmod(fake_cc_py, 0o755)