From add176331eb8dbae1dcef529e551e7375b73c67a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 27 Feb 2023 13:51:46 +0100 Subject: [PATCH] better debug --- tiramisu/option/portoption.py | 3 --- tiramisu/setting.py | 1 + tiramisu/value.py | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tiramisu/option/portoption.py b/tiramisu/option/portoption.py index c277344..eb36517 100644 --- a/tiramisu/option/portoption.py +++ b/tiramisu/option/portoption.py @@ -19,11 +19,8 @@ # the whole pypy projet is under MIT licence # ____________________________________________________________ import re -import sys -from ..setting import undefined, Undefined, OptionBag from ..i18n import _ -from .option import Option from .stroption import StrOption diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 36a4abe..50e25df 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -117,6 +117,7 @@ FORBIDDEN_SET_PERMISSIVES = frozenset(['force_default_on_freeze', 'force_metaconfig_on_freeze', 'force_store_value']) ALLOWED_LEADER_PROPERTIES = frozenset(['empty', + 'notempty', 'notunique', 'unique', 'force_store_value', diff --git a/tiramisu/value.py b/tiramisu/value.py index 21e8ccf..e67b7f4 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -175,7 +175,11 @@ class Values: value, reset_cache=True): if isinstance(value, Calculation): - value = await value.execute(option_bag) + try: + value = await value.execute(option_bag) + except ConfigError as err: + msg = _(f'error when calculating "{option_bag.option.impl_get_display_name()}": {err} : {option_bag.path}') + raise ConfigError(msg) from err elif isinstance(value, (list, tuple)): value = await self._do_value_list(value, option_bag) if reset_cache: