diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 21:06:45 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 22:26:29 +0100 |
commit | 9f08b901375ba640f47596f1bcf43f98a931550f (patch) | |
tree | 061dade29876b4ef187460c166cbad15a1f485ae /lib/bb/process.py | |
parent | 3627b02f77c78beedadadd77c619b9e5edaae076 (diff) | |
download | bitbake-9f08b901375ba640f47596f1bcf43f98a931550f.tar.gz |
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
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/process.py')
-rw-r--r-- | lib/bb/process.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/process.py b/lib/bb/process.py index 05b51725f..1aeec788c 100644 --- a/lib/bb/process.py +++ b/lib/bb/process.py @@ -102,6 +102,10 @@ def _logged_communicate(pipe, log, input): log.write(data) finally: log.flush() + if pipe.stdout is not None: + pipe.stdout.close() + if pipe.stderr is not None: + pipe.stderr.close() return ''.join(outdata), ''.join(errdata) def run(cmd, input=None, log=None, **options): |