summaryrefslogtreecommitdiffstats
path: root/test/chained-build.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/chained-build.py')
-rw-r--r--test/chained-build.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/chained-build.py b/test/chained-build.py
index c3351e1..871a593 100644
--- a/test/chained-build.py
+++ b/test/chained-build.py
@@ -38,7 +38,8 @@ test.subdir('w1')
SConstruct1_contents = """\
def build(env, target, source):
- open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
+ with open(str(target[0]), 'wt') as fo, open(str(source[0]), 'rt') as fi:
+ fo.write(fi.read())
env=Environment(BUILDERS={'B' : Builder(action=build)})
env.B('foo.mid', 'foo.in')
@@ -46,7 +47,8 @@ env.B('foo.mid', 'foo.in')
SConstruct2_contents = """\
def build(env, target, source):
- open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
+ with open(str(target[0]), 'wt') as fo, open(str(source[0]), 'rt') as fi:
+ fo.write(fi.read())
env=Environment(BUILDERS={'B' : Builder(action=build)})
env.B('foo.out', 'foo.mid')