summaryrefslogtreecommitdiffstats
path: root/test/Parallel/duplicate-children.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parallel/duplicate-children.py')
-rw-r--r--test/Parallel/duplicate-children.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Parallel/duplicate-children.py b/test/Parallel/duplicate-children.py
index 8b8f4cd..fab1e58 100644
--- a/test/Parallel/duplicate-children.py
+++ b/test/Parallel/duplicate-children.py
@@ -37,10 +37,10 @@ test = TestSCons.TestSCons()
test.write('cat.py', """\
import sys
-fp = open(sys.argv[1], 'wb')
-for fname in sys.argv[2:]:
- fp.write(open(fname, 'rb').read())
-fp.close()
+with open(sys.argv[1], 'wb') as ofp:
+ for fname in sys.argv[2:]:
+ with open(fname, 'rb') as ifp:
+ ofp.write(ifp.read())
""")
test.write('sleep.py', """\