summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2020-03-12 13:30:04 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-13 11:29:23 +0000
commitbf7d68c812e9807d88b529212487dda7fa60245a (patch)
tree241d366151d904f55cb75cc4626748000b17e3d1 /bitbake
parent5ce50b3ce7ba91b9e34a9ce8f17b4ff43a8c73e6 (diff)
downloadpoky-bf7d68c812e9807d88b529212487dda7fa60245a.tar.gz
bitbake: knotty/msg: 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 (Bitbake rev: 970cd2fc4f0bbc93069dee5a15a608dd76081c67) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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