summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-22 19:02:39 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-23 08:22:42 (GMT)
commit999ee044b92ea08ee86460b7c1a217ad26e0af2b (patch)
tree69a793185d4efed975a2642c93f1919cfaedf428 /bitbake/lib
parent64c002875fe0a153760f174b868dc702227c00af (diff)
downloadpoky-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')
-rw-r--r--bitbake/lib/bb/utils.py8
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"):
216 for line in body: 216 for line in body:
217 logger.error(line) 217 logger.error(line)
218 218
219 raise 219 e = bb.BBHandledException(e)
220 raise e
220 221
221def better_exec(code, context, text = None, realfile = "<code>"): 222def better_exec(code, context, text = None, realfile = "<code>"):
222 """ 223 """
@@ -231,7 +232,7 @@ def better_exec(code, context, text = None, realfile = "<code>"):
231 code = better_compile(code, realfile, realfile) 232 code = better_compile(code, realfile, realfile)
232 try: 233 try:
233 exec(code, _context, context) 234 exec(code, _context, context)
234 except Exception: 235 except Exception as e:
235 (t, value, tb) = sys.exc_info() 236 (t, value, tb) = sys.exc_info()
236 237
237 if t in [bb.parse.SkipPackage, bb.build.FuncFailed]: 238 if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
@@ -280,7 +281,8 @@ def better_exec(code, context, text = None, realfile = "<code>"):
280 nexttb = tb.tb_next 281 nexttb = tb.tb_next
281 level = level + 1 282 level = level + 1
282 283
283 raise 284 e = bb.BBHandledException(e)
285 raise e
284 286
285def simple_exec(code, context): 287def simple_exec(code, context):
286 exec(code, _context, context) 288 exec(code, _context, context)