]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
event: prevent unclosed file warning in print_ui_queue
authorJoshua Lock <joshua.g.lock@intel.com>
Tue, 4 Oct 2016 10:03:55 +0000 (11:03 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Oct 2016 09:25:26 +0000 (10:25 +0100)
commit1e23b1f1a80066223b98e18b163840051ac74944
tree0ece242b6abfc9616284d4c7d7240be71d6e267c
parent100a0aef3d121d950d89c4152f56957628f2f933
event: prevent unclosed file warning in print_ui_queue

Use logger.addHandler(), rather than assigning an array of Handlers
to the loggers handlers property directly, to avoid a warning from
Python 3 about unclosed files:

$ bitbake
Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
WARNING: /home/joshuagl/Projects/poky/bitbake/lib/bb/event.py:143: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/joshuagl/Projects/poky/build/tmp/log/cooker/qemux86/20161004094928.log' mode='a' encoding='UTF-8'>
  logger.handlers = [stdout]

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/event.py