This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch aevri/provenance_scope in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 6937f7f7c64385766443a41dbf9be2afaef55a14 Author: Angelos Evripiotis <[email protected]> AuthorDate: Fri Mar 15 17:45:32 2019 +0000 optionpool: use context_for_bsterror --- buildstream/_options/optionpool.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/buildstream/_options/optionpool.py b/buildstream/_options/optionpool.py index 3132af5..716be77 100644 --- a/buildstream/_options/optionpool.py +++ b/buildstream/_options/optionpool.py @@ -22,7 +22,7 @@ from collections.abc import Mapping import jinja2 from .. import _yaml -from .._exceptions import LoadError, LoadErrorReason +from .._exceptions import LoadError, LoadErrorReason, context_for_bsterror from .optionbool import OptionBool from .optionenum import OptionEnum from .optionflags import OptionFlags @@ -277,11 +277,8 @@ class OptionPool(): "{}: Conditional statement has more than one key".format(p)) expression, value = tuples[0] - try: + with context_for_bsterror(p): apply_fragment = self._evaluate(expression) - except LoadError as e: - # Prepend the provenance of the error - raise LoadError(e.reason, "{}: {}".format(p, e)) from e if not hasattr(value, 'get'): raise LoadError(LoadErrorReason.ILLEGAL_COMPOSITE,
