summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/SourceCode/SourceCode.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-04-28 19:43:43 (GMT)
committerGitHub <noreply@github.com>2019-04-28 19:43:43 (GMT)
commit35e6bbe16a859b42efca4592b435695a530f0717 (patch)
tree5a298b113bb1899e91583866b41eb9c337c0857e /test/Deprecated/SourceCode/SourceCode.py
parent44c7b81e1a47ff5d4439740b1e929ea723ee1f18 (diff)
parent4ecdcf07580b1bfcd03f7886b6ab9256ee825175 (diff)
downloadSCons-35e6bbe16a859b42efca4592b435695a530f0717.zip
SCons-35e6bbe16a859b42efca4592b435695a530f0717.tar.gz
SCons-35e6bbe16a859b42efca4592b435695a530f0717.tar.bz2
Merge pull request #3345 from mwichmann/py38warns4-tests
[wip] Py38warns4 tests
Diffstat (limited to 'test/Deprecated/SourceCode/SourceCode.py')
-rw-r--r--test/Deprecated/SourceCode/SourceCode.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Deprecated/SourceCode/SourceCode.py b/test/Deprecated/SourceCode/SourceCode.py
index b5c0ba9..b7f1305 100644
--- a/test/Deprecated/SourceCode/SourceCode.py
+++ b/test/Deprecated/SourceCode/SourceCode.py
@@ -49,10 +49,10 @@ import os
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())
def sc_cat(env, source, target):
source = []