summaryrefslogtreecommitdiffstats
path: root/test/Climb/explicit-parent--U.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Climb/explicit-parent--U.py')
-rw-r--r--test/Climb/explicit-parent--U.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Climb/explicit-parent--U.py b/test/Climb/explicit-parent--U.py
index ab2d33e..5308632 100644
--- a/test/Climb/explicit-parent--U.py
+++ b/test/Climb/explicit-parent--U.py
@@ -38,10 +38,10 @@ test.subdir('subdir')
test.write('SConstruct', """\
def cat(env, source, target):
target = str(target[0])
- f = open(target, "wb")
- for src in source:
- f.write(open(str(src), "rb").read())
- f.close()
+ with open(target, 'wb') as ofp:
+ for src in source:
+ with open(str(src), 'rb') as ifp:
+ ofp.write(ifp.read())
env = Environment(BUILDERS={'Cat':Builder(action=cat)})
env.Cat('foo.out', 'foo.in')
SConscript('subdir/SConscript', "env")