From 7d06ec193ee5f4c4910365981ccbfc717d87b573 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 11 May 2016 22:55:53 +0100 Subject: bitbake: knotty: Ensure consolelog file handle is closed If we don't close the console log file handle, python prints a warning about unclosed file handles upon exit which is annoying. (Bitbake rev: 624dd92952b2fc736fd86abe5f2390b87b3a7dd3) Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/knotty.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 903d72b565..85a71f45ec 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -278,6 +278,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): server.terminateServer() return + consolelog = None if consolelogfile and not params.options.show_environment and not params.options.show_versions: bb.utils.mkdirhier(os.path.dirname(consolelogfile)) conlogformat = bb.msg.BBLogFormatter(format_str) @@ -591,4 +592,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): if e.errno == errno.EPIPE: pass + if consolelog: + logger.removeHandler(consolelog) + consolelog.close() + return return_value -- cgit v1.2.3-54-g00ecf