summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/SourceSignatures/basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Deprecated/SourceSignatures/basic.py')
-rw-r--r--test/Deprecated/SourceSignatures/basic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/Deprecated/SourceSignatures/basic.py b/test/Deprecated/SourceSignatures/basic.py
index 52a2c5c..7951dbd 100644
--- a/test/Deprecated/SourceSignatures/basic.py
+++ b/test/Deprecated/SourceSignatures/basic.py
@@ -35,7 +35,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
base_sconstruct_contents = """\
SetOption('warn', 'deprecated-source-signatures')
def build(env, target, source):
- open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
+ with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp:
+ ofp.write(ifp.read())
B = Builder(action = build)
env = Environment(BUILDERS = { 'B' : B })
env.B(target = 'f1.out', source = 'f1.in')