diff options
Diffstat (limited to 'test/SideEffect/directory.py')
-rw-r--r-- | test/SideEffect/directory.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/SideEffect/directory.py b/test/SideEffect/directory.py index 23f50af..9fcbea2 100644 --- a/test/SideEffect/directory.py +++ b/test/SideEffect/directory.py @@ -37,7 +37,8 @@ import os.path import os def copy(source, target): - open(target, "wb").write(open(source, "rb").read()) + with open(target, "wb") as ofp, open(source, "rb") as ifp: + ofp.write(ifp.read()) def build(env, source, target): copy(str(source[0]), str(target[0])) |