summaryrefslogtreecommitdiffstats
path: root/test/Clean/basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Clean/basic.py')
-rw-r--r--test/Clean/basic.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/Clean/basic.py b/test/Clean/basic.py
index e9f0540..fbff9b1 100644
--- a/test/Clean/basic.py
+++ b/test/Clean/basic.py
@@ -38,10 +38,8 @@ test = TestSCons.TestSCons()
test.write('build.py', r"""
import sys
-contents = open(sys.argv[2], 'rb').read()
-file = open(sys.argv[1], 'wb')
-file.write(contents)
-file.close()
+with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp:
+ ofp.write(ifp.read())
""")
test.write('SConstruct', """