diff options
Diffstat (limited to 'test/SPAWN.py')
-rw-r--r-- | test/SPAWN.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/SPAWN.py b/test/SPAWN.py index 6802524..fba21d5 100644 --- a/test/SPAWN.py +++ b/test/SPAWN.py @@ -36,10 +36,10 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -ofp = open(sys.argv[1], 'wb') -for s in sys.argv[2:]: - ofp.write(open(s, 'rb').read()) -ofp.close() +with open(sys.argv[1], 'wb') as ofp: + for s in sys.argv[2:]: + with open(s, 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ |