aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/msg.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-12 08:05:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-12 23:01:03 +0100
commitd7db75020ed727677afbad07a90fb3eac0bf2c45 (patch)
treedda2aa90e6184203491cb86fcba71e2b4a152a4b /lib/bb/msg.py
parentca8c91acc9396385834b266d4e8b84d917e5e298 (diff)
downloadbitbake-contrib-d7db75020ed727677afbad07a90fb3eac0bf2c45.tar.gz
event/msg: Pass formatted exceptions
python3 can't cope with the previous approach we were using to pass exceptions through the RPC. Avoid this by creating a formatted exception on the sender side. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r--lib/bb/msg.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index 786b5aef4..6fdd1f52a 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -90,8 +90,9 @@ class BBLogFormatter(logging.Formatter):
if self.color_enabled:
record = self.colorize(record)
msg = logging.Formatter.format(self, record)
-
- if hasattr(record, 'bb_exc_info'):
+ if hasattr(record, 'bb_exc_formatted'):
+ msg += '\n' + ''.join(record.bb_exc_formatted)
+ elif hasattr(record, 'bb_exc_info'):
etype, value, tb = record.bb_exc_info
formatted = bb.exceptions.format_exception(etype, value, tb, limit=5)
msg += '\n' + ''.join(formatted)