[oe-commits] [bitbake] 03/03: bitbake: Use logging.shutdown() instead of bb.msg.cleanupLogging()
git at git.openembedded.org
git at git.openembedded.org
Thu Mar 12 22:53:08 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit b2a92887a208a3973453a7eda43bac2ca7660604
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Thu Mar 12 13:30:04 2020 -0500
bitbake: Use logging.shutdown() instead of bb.msg.cleanupLogging()
The logging module provides a shutdown() function that does the same
thing in a much better way
Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/msg.py | 11 -----------
lib/bb/ui/knotty.py | 2 +-
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index 2ba4824..c0b344e 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -330,14 +330,3 @@ def setLoggingConfig(defaultconfig, userconfigfile=None):
# bb.msg.loggerDefaultLogLevel = newlevel
return conf
-
-def cleanupLogging():
- # Iterate through all the handlers and close them if possible. Fixes
- # 'Unclosed resource' warnings when bitbake exits, see
- # https://bugs.python.org/issue23010
- handlers = set()
- for logger_iter in logging.Logger.manager.loggerDict.keys():
- handlers.update(logging.getLogger(logger_iter).handlers)
-
- for h in handlers:
- h.close()
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 826aa8c..87e873d 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -871,6 +871,6 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if e.errno == errno.EPIPE:
pass
- bb.msg.cleanupLogging()
+ logging.shutdown()
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