From 8a43a6a32bafc654046250f5362509fd92dd4d10 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 30 May 2014 15:56:11 +0100 Subject: bitbake: build/utils: Fix broken exception handling Checking for explicit exception names is bad, we also want to be able top rely on inheritance. Fix these checks to be part of the real except clauses so SkipPackage is recognised as being inherited from SkipRecipe. (Bitbake rev: b131229145e1f2c372d6230a7b554e436c13c3f9) Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/utils.py') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index c179394dc9..96d8218812 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -354,16 +354,11 @@ def better_exec(code, context, text = None, realfile = ""): code = better_compile(code, realfile, realfile) try: exec(code, get_context(), context) - except bb.BBHandledException: - # Error already shown so passthrough - raise - except bb.data_smart.ExpansionError: + except (bb.BBHandledException, bb.parse.SkipRecipe, bb.build.FuncFailed, bb.data_smart.ExpansionError): + # Error already shown so passthrough, no need for traceback raise except Exception as e: (t, value, tb) = sys.exc_info() - - if t in [bb.parse.SkipRecipe, bb.build.FuncFailed]: - raise try: _print_exception(t, value, tb, realfile, text, context) except Exception as e: -- cgit v1.2.3-54-g00ecf