diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-11 22:55:53 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:32 +0100 |
| commit | 7d06ec193ee5f4c4910365981ccbfc717d87b573 (patch) | |
| tree | b25da8636f81dcaa65c66d59a17c1180b501d99b | |
| parent | 6cc681806843a89a5bcaa0e733f8a97d88f1a8c2 (diff) | |
| download | poky-7d06ec193ee5f4c4910365981ccbfc717d87b573.tar.gz | |
bitbake: 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.
(Bitbake rev: 624dd92952b2fc736fd86abe5f2390b87b3a7dd3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 903d72b565..85a71f45ec 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -278,6 +278,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 278 | server.terminateServer() | 278 | server.terminateServer() |
| 279 | return | 279 | return |
| 280 | 280 | ||
| 281 | consolelog = None | ||
| 281 | if consolelogfile and not params.options.show_environment and not params.options.show_versions: | 282 | if consolelogfile and not params.options.show_environment and not params.options.show_versions: |
| 282 | bb.utils.mkdirhier(os.path.dirname(consolelogfile)) | 283 | bb.utils.mkdirhier(os.path.dirname(consolelogfile)) |
| 283 | conlogformat = bb.msg.BBLogFormatter(format_str) | 284 | conlogformat = bb.msg.BBLogFormatter(format_str) |
| @@ -591,4 +592,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 591 | if e.errno == errno.EPIPE: | 592 | if e.errno == errno.EPIPE: |
| 592 | pass | 593 | pass |
| 593 | 594 | ||
| 595 | if consolelog: | ||
| 596 | logger.removeHandler(consolelog) | ||
| 597 | consolelog.close() | ||
| 598 | |||
| 594 | return return_value | 599 | return return_value |
