summaryrefslogtreecommitdiffstats
path: root/test/ignore-command.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ignore-command.py')
-rw-r--r--test/ignore-command.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ignore-command.py b/test/ignore-command.py
index 9fd24ab..d5c18a5 100644
--- a/test/ignore-command.py
+++ b/test/ignore-command.py
@@ -40,10 +40,10 @@ test.subdir('build', 'src')
test.write('build.py', r"""
import sys
-fp = open(sys.argv[1], 'wb')
-for f in sys.argv[2:]:
- fp.write(open(f, 'rb').read())
-fp.close()
+with open(sys.argv[1], 'wb') as fp:
+ for f in sys.argv[2:]:
+ with open(f, 'rb') as ifp:
+ fp.write(ifp.read())
sys.exit(1)
""")