summaryrefslogtreecommitdiffstats
path: root/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-30 15:56:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-31 00:04:38 +0100
commitb131229145e1f2c372d6230a7b554e436c13c3f9 (patch)
tree0cc56e0117bfb6bdd9508753bfc3aacb3afd4f32 /lib/bb/utils.py
parent181a9735d02ebd517378558e909efc8b1b118973 (diff)
downloadopenembedded-core-contrib-b131229145e1f2c372d6230a7b554e436c13c3f9.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r--lib/bb/utils.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index c179394dc9..96d8218812 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -354,16 +354,11 @@ def better_exec(code, context, text = None, realfile = "<code>"):
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: