[oe-commits] [bitbake] 03/11: knotty: Ensure consolelog file handle is closed

git at git.openembedded.org git at git.openembedded.org
Wed May 11 15:15:31 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 4063a634932b984d6fdd3dcdd52235c7e096a15e
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed May 11 14:15:58 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