diff options
Diffstat (limited to 'test/Builder/multi/multi.py')
-rw-r--r-- | test/Builder/multi/multi.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Builder/multi/multi.py b/test/Builder/multi/multi.py index 0f83d71..aec0951 100644 --- a/test/Builder/multi/multi.py +++ b/test/Builder/multi/multi.py @@ -37,9 +37,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) |