summaryrefslogtreecommitdiff
path: root/testing/framework/SConscript
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:55:05 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:55:05 +0200
commitd240a76169c685e488fe7352adec69d39c60ef9f (patch)
tree144aeb4702d258b0cfaf99cffb9f21e94b026459 /testing/framework/SConscript
parent6ca68f29862bc7cbe5428426eee600cb1f3c05c1 (diff)
parentc2d9eaeffe9d77d8d5087fb21a3256fde32047d4 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'testing/framework/SConscript')
-rw-r--r--testing/framework/SConscript13
1 files changed, 7 insertions, 6 deletions
diff --git a/testing/framework/SConscript b/testing/framework/SConscript
index 535f187..f79a254 100644
--- a/testing/framework/SConscript
+++ b/testing/framework/SConscript
@@ -41,12 +41,13 @@ files = [
def copy(target, source, env):
t = str(target[0])
s = str(source[0])
- c = open(s, 'r').read()
- # Note: We construct the __ VERSION __ substitution string at
- # run-time so it doesn't get replaced when this file gets copied
- # into the tree for packaging.
- c = c.replace('__' + 'VERSION' + '__', env['VERSION'])
- open(t, 'w').write(c)
+ with open(s, 'r') as i, open(t, 'w') as o:
+ c = i.read()
+ # Note: We construct the __ VERSION __ substitution string at
+ # run-time so it doesn't get replaced when this file gets copied
+ # into the tree for packaging.
+ c = c.replace('__' + 'VERSION' + '__', env['VERSION'])
+ o.write(c)
for file in files:
# Guarantee that real copies of these files always exist in