summaryrefslogtreecommitdiffstats
path: root/test/silent-command.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/silent-command.py')
-rw-r--r--test/silent-command.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/silent-command.py b/test/silent-command.py
index b0e4a2e..7f3b010 100644
--- a/test/silent-command.py
+++ b/test/silent-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())
""")
test.write('SConstruct', """\