summaryrefslogtreecommitdiffstats
path: root/test/chdir.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/chdir.py')
-rw-r--r--test/chdir.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/chdir.py b/test/chdir.py
index c4d392e..696488b 100644
--- a/test/chdir.py
+++ b/test/chdir.py
@@ -91,11 +91,10 @@ other9_f19_in = test.workpath('other9', 'f19.in')
test.write(cat_py, """\
import sys
-ofp = open(sys.argv[1], 'wb')
-for f in sys.argv[2:]:
- ifp = open(f, 'rb')
- ofp.write(ifp.read())
-ofp.close
+with open(sys.argv[1], 'wb') as ofp:
+ for f in sys.argv[2:]:
+ with open(f, 'rb') as ifp:
+ ofp.write(ifp.read())
""")
test.write(['work1', 'SConstruct'], """