summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/process.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 21:06:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 22:28:04 +0100
commit4a081b5a52e3d27da8d4b062f3fda292e8d8fb0a (patch)
treea555b39b41e4ec36c212481fcd2887cde2ee30dd /bitbake/lib/bb/process.py
parent7f2bf08280f11daa002f4a9e870c2b77711cbf90 (diff)
downloadpoky-4a081b5a52e3d27da8d4b062f3fda292e8d8fb0a.tar.gz
bitbake: lib: Clean up various file access syntax
Python 3 is stricter about how files are accessed. Specficially: * Use open(), not file() * Use binary mode for binary files (when checksumming) * Use with statements to ensure files get closed * Add missing file close statements (Bitbake rev: 9f08b901375ba640f47596f1bcf43f98a931550f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/process.py')
-rw-r--r--bitbake/lib/bb/process.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py
index 05b51725f1..1aeec788c1 100644
--- a/bitbake/lib/bb/process.py
+++ b/bitbake/lib/bb/process.py
@@ -102,6 +102,10 @@ def _logged_communicate(pipe, log, input):
102 log.write(data) 102 log.write(data)
103 finally: 103 finally:
104 log.flush() 104 log.flush()
105 if pipe.stdout is not None:
106 pipe.stdout.close()
107 if pipe.stderr is not None:
108 pipe.stderr.close()
105 return ''.join(outdata), ''.join(errdata) 109 return ''.join(outdata), ''.join(errdata)
106 110
107def run(cmd, input=None, log=None, **options): 111def run(cmd, input=None, log=None, **options):