summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/msg.py11
-rw-r--r--bitbake/lib/bb/ui/knotty.py2
2 files changed, 1 insertions, 12 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 2ba4824227..c0b344e323 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -330,14 +330,3 @@ def setLoggingConfig(defaultconfig, userconfigfile=None):
330 # bb.msg.loggerDefaultLogLevel = newlevel 330 # bb.msg.loggerDefaultLogLevel = newlevel
331 331
332 return conf 332 return conf
333
334def cleanupLogging():
335 # Iterate through all the handlers and close them if possible. Fixes
336 # 'Unclosed resource' warnings when bitbake exits, see
337 # https://bugs.python.org/issue23010
338 handlers = set()
339 for logger_iter in logging.Logger.manager.loggerDict.keys():
340 handlers.update(logging.getLogger(logger_iter).handlers)
341
342 for h in handlers:
343 h.close()
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 826aa8c3e7..87e873d644 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -871,6 +871,6 @@ def main(server, eventHandler, params, tf = TerminalFilter):
871 if e.errno == errno.EPIPE: 871 if e.errno == errno.EPIPE:
872 pass 872 pass
873 873
874 bb.msg.cleanupLogging() 874 logging.shutdown()
875 875
876 return return_value 876 return return_value