summaryrefslogtreecommitdiffstats
path: root/test/CacheDir/source-scanner.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/CacheDir/source-scanner.py')
-rw-r--r--test/CacheDir/source-scanner.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/CacheDir/source-scanner.py b/test/CacheDir/source-scanner.py
index f00360d..1c56499 100644
--- a/test/CacheDir/source-scanner.py
+++ b/test/CacheDir/source-scanner.py
@@ -50,9 +50,8 @@ CacheDir(r'%(cache)s')
def docopy(target,source,env):
data = source[0].get_contents()
- f = open(target[0].rfile().get_abspath(), "wb")
- f.write(data)
- f.close()
+ with open(target[0].rfile().get_abspath(), "wb") as f:
+ f.write(data)
def sillyScanner(node, env, dirs):
print('This is never called (unless we build file.out)')