[oe-commits] [bitbake] 03/18: knotty: Ensure consolelog file handle is closed
git at git.openembedded.org
git at git.openembedded.org
Thu May 12 08:41:16 UTC 2016
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 624dd92952b2fc736fd86abe5f2390b87b3a7dd3
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed May 11 22:55:53 2016 +0100
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.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/ui/knotty.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 903d72b..85a71f4 100644
--- a/lib/bb/ui/knotty.py
+++ b/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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list