summaryrefslogtreecommitdiffstats
path: root/test/Install/wrap-by-attribute.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Install/wrap-by-attribute.py')
-rw-r--r--test/Install/wrap-by-attribute.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Install/wrap-by-attribute.py b/test/Install/wrap-by-attribute.py
index 6989fa8..014b7a5 100644
--- a/test/Install/wrap-by-attribute.py
+++ b/test/Install/wrap-by-attribute.py
@@ -47,10 +47,10 @@ import os.path
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(tools=[], DESTDIR='dest')
env.Append(BUILDERS={'Cat':Builder(action=cat)})