From: Richard Purdie Date: Fri, 14 Dec 2012 12:33:01 +0000 (+0000) Subject: data_smart/BBHandler: Fix SkipParse exception handling X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7467d7d66b24cc8f43ab168e65895e7c4aee6092;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git data_smart/BBHandler: Fix SkipParse exception handling If SkipParse is raised from something which isn't anonymous python, it wasn't being handled correctly. This improves the handling for example from within inline python. Signed-off-by: Richard Purdie --- diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index fb8d9d53c00..d3284009035 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -143,6 +143,8 @@ class DataSmart(MutableMapping): break except ExpansionError: raise + except bb.parse.SkipPackage: + raise except Exception as exc: raise ExpansionError(varname, s, exc) diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py index e6039e11a20..2ee8ebd28f5 100644 --- a/lib/bb/parse/parse_py/BBHandler.py +++ b/lib/bb/parse/parse_py/BBHandler.py @@ -153,7 +153,12 @@ def handle(fn, d, include): if ext != ".bbclass": data.setVar('FILE', abs_fn, d) - statements.eval(d) + try: + statements.eval(d) + except bb.parse.SkipPackage: + bb.data.setVar("__SKIPPED", True, d) + if include == 0: + return { "" : d } if ext != ".bbclass" and include == 0: return ast.multi_finalize(fn, d)