summaryrefslogtreecommitdiffstats
path: root/test/Glob/source.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Glob/source.py')
-rw-r--r--test/Glob/source.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Glob/source.py b/test/Glob/source.py
index 3d40d05..33aff85 100644
--- a/test/Glob/source.py
+++ b/test/Glob/source.py
@@ -41,10 +41,10 @@ DefaultEnvironment(tools=[])
env = Environment(tools=[])
def concatenate(target, source, env):
- fp = open(str(target[0]), 'wb')
- for s in source:
- fp.write(open(str(s), 'rb').read())
- fp.close()
+ with open(str(target[0]), 'wb') as ofp:
+ for s in source:
+ with open(str(s), 'rb') as ifp:
+ ofp.write(ifp.read())
env['BUILDERS']['Concatenate'] = Builder(action=concatenate)