From 1a0c39e05067aa1b3c70de08380b8032227bf690 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 5 Dec 2010 22:51:38 +0000 Subject: bitbake/utils.py: Ensure the last lines of functions are printed in tracebacks Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index c2e6ff08e..ed28f86c4 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -304,9 +304,12 @@ def _print_trace(body, line): """ # print the environment of the method min_line = max(1, line-4) - max_line = min(line + 4, len(body)-1) + max_line = min(line + 4, len(body)) for i in range(min_line, max_line + 1): - bb.msg.error(bb.msg.domain.Util, "\t%.4d:%s" % (i, body[i-1]) ) + if line == i: + bb.msg.error(bb.msg.domain.Util, " *** %.4d:%s" % (i, body[i-1]) ) + else: + bb.msg.error(bb.msg.domain.Util, " %.4d:%s" % (i, body[i-1]) ) def better_compile(text, file, realfile, mode = "exec"): -- cgit v1.2.3