diff options
Diffstat (limited to 'test/subdir.py')
-rw-r--r-- | test/subdir.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/subdir.py b/test/subdir.py index 9a8b762..363d44c 100644 --- a/test/subdir.py +++ b/test/subdir.py @@ -35,10 +35,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'r').read() -file = open(sys.argv[1], 'w') -file.write(contents) -file.close() +with open(sys.argv[1], 'w') as f, open(sys.argv[2], 'r') as ifp: + f.write(ifp.read()) """) test.write('SConstruct', """ |