summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-05-05 19:07:21 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-08 20:38:24 +0100
commit63d14f474d52430f19653ef7ed881cd8dbaf3f42 (patch)
tree12af74e708c84ef11ae55d0bbffa037e720ae150 /bitbake/lib
parent5b4b6bc7f7b24cb02811905b065304ba6b7e6e07 (diff)
downloadast2050-yocto-poky-63d14f474d52430f19653ef7ed881cd8dbaf3f42.zip
ast2050-yocto-poky-63d14f474d52430f19653ef7ed881cd8dbaf3f42.tar.gz
bb.exceptions: handle tb entries without context
(Bitbake rev: b010c4d37cfff5f74747d7da8cc1bf6719e29357) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/exceptions.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/exceptions.py b/bitbake/lib/bb/exceptions.py
index e134ae1..86621d2 100644
--- a/bitbake/lib/bb/exceptions.py
+++ b/bitbake/lib/bb/exceptions.py
@@ -8,10 +8,13 @@ from collections import namedtuple
class TracebackEntry(namedtuple.abc):
"""Pickleable representation of a traceback entry"""
_fields = 'filename lineno function args code_context index'
- _header = ' File "{0.filename}", line {0.lineno}, in {0.function}{0.args}:\n'
+ _header = ' File "{0.filename}", line {0.lineno}, in {0.function}{0.args}'
def format(self, formatter=None):
- formatted = [self._header.format(self)]
+ if not self.code_context:
+ return self._header.format(self) + '\n'
+
+ formatted = [self._header.format(self) + ':\n']
for lineindex, line in enumerate(self.code_context):
if formatter:
OpenPOWER on IntegriCloud