summaryrefslogtreecommitdiffstats
path: root/test/Glob/strings.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Glob/strings.py')
-rw-r--r--test/Glob/strings.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Glob/strings.py b/test/Glob/strings.py
index 0780ace..2a4a624 100644
--- a/test/Glob/strings.py
+++ b/test/Glob/strings.py
@@ -49,10 +49,10 @@ test.write(['src', 'SConscript'], """\
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)