summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/exceptions.py')
-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 e134ae136d..86621d24ba 100644
--- a/bitbake/lib/bb/exceptions.py
+++ b/bitbake/lib/bb/exceptions.py
@@ -8,10 +8,13 @@ from collections import namedtuple
8class TracebackEntry(namedtuple.abc): 8class TracebackEntry(namedtuple.abc):
9 """Pickleable representation of a traceback entry""" 9 """Pickleable representation of a traceback entry"""
10 _fields = 'filename lineno function args code_context index' 10 _fields = 'filename lineno function args code_context index'
11 _header = ' File "{0.filename}", line {0.lineno}, in {0.function}{0.args}:\n' 11 _header = ' File "{0.filename}", line {0.lineno}, in {0.function}{0.args}'
12 12
13 def format(self, formatter=None): 13 def format(self, formatter=None):
14 formatted = [self._header.format(self)] 14 if not self.code_context:
15 return self._header.format(self) + '\n'
16
17 formatted = [self._header.format(self) + ':\n']
15 18
16 for lineindex, line in enumerate(self.code_context): 19 for lineindex, line in enumerate(self.code_context):
17 if formatter: 20 if formatter: