summaryrefslogtreecommitdiffstats
path: root/test/Ignore.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Ignore.py')
-rw-r--r--test/Ignore.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/Ignore.py b/test/Ignore.py
index 0716e11..053f785 100644
--- a/test/Ignore.py
+++ b/test/Ignore.py
@@ -36,11 +36,12 @@ test.subdir('subdir')
test.write('build.py', r"""
import sys
-contents = open(sys.argv[2], 'rb').read() + open(sys.argv[3], 'rb').read()
-file = open(sys.argv[1], 'wb')
-for arg in sys.argv[2:]:
- file.write(open(arg, 'rb').read())
-file.close()
+with open(sys.argv[2], 'rb') as afp2, open(sys.argv[3], 'rb') as afp3:
+ contents = afp2.read() + afp3.read()
+with open(sys.argv[1], 'wb') as f:
+ for arg in sys.argv[2:]:
+ with open(arg, 'rb') as ifp:
+ f.write(ifp.read())
""")
SUBDIR_f3_out = os.path.join('$SUBDIR', 'f3.out')