From 4a081b5a52e3d27da8d4b062f3fda292e8d8fb0a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 9 May 2013 21:06:45 +0000 Subject: 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 --- bitbake/lib/bb/process.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bitbake/lib/bb/process.py') 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): 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): -- cgit v1.2.3-54-g00ecf