diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-22 20:02:39 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-23 09:22:42 +0100 |
commit | 999ee044b92ea08ee86460b7c1a217ad26e0af2b (patch) | |
tree | 69a793185d4efed975a2642c93f1919cfaedf428 /bitbake/lib/bb/utils.py | |
parent | 64c002875fe0a153760f174b868dc702227c00af (diff) | |
download | ast2050-yocto-poky-999ee044b92ea08ee86460b7c1a217ad26e0af2b.zip ast2050-yocto-poky-999ee044b92ea08ee86460b7c1a217ad26e0af2b.tar.gz |
bitbake: utils.py: Once we've printed errors messages, suppress the backtrace
Adding a generic backtrace to better_compile and better_exec is pointless,
therefore reraise the exception as a bb.BBHandledException so the
generic code doesn't confuse the user even more.
(Bitbake rev: b3d97130e1e70fe969399277dcd7cccd888103d6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index e0ef63c..82dab6b 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -216,7 +216,8 @@ def better_compile(text, file, realfile, mode = "exec"): for line in body: logger.error(line) - raise + e = bb.BBHandledException(e) + raise e def better_exec(code, context, text = None, realfile = "<code>"): """ @@ -231,7 +232,7 @@ def better_exec(code, context, text = None, realfile = "<code>"): code = better_compile(code, realfile, realfile) try: exec(code, _context, context) - except Exception: + except Exception as e: (t, value, tb) = sys.exc_info() if t in [bb.parse.SkipPackage, bb.build.FuncFailed]: @@ -280,7 +281,8 @@ def better_exec(code, context, text = None, realfile = "<code>"): nexttb = tb.tb_next level = level + 1 - raise + e = bb.BBHandledException(e) + raise e def simple_exec(code, context): exec(code, _context, context) |