summaryrefslogtreecommitdiffstats
path: root/test/SHELL.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/SHELL.py')
-rw-r--r--test/SHELL.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/SHELL.py b/test/SHELL.py
index faee27f..5d97b97 100644
--- a/test/SHELL.py
+++ b/test/SHELL.py
@@ -57,10 +57,10 @@ def stripquote(s):
return s
args = stripquote(sys.argv[2]).split()
args = list(map(stripquote, args))
-ofp = open(args[2], 'wb')
-for f in args[3:] + ['extra.txt']:
- ofp.write(open(f, 'rb').read())
-ofp.close()
+with open(args[2], 'wb') as ofp:
+ for f in args[3:] + ['extra.txt']:
+ with open(f, 'rb') as ifp:
+ ofp.write(ifp.read())
sys.exit(0)
""" % locals())