From 89c095e0d3c55d35132c79704a2cff186e74f3cb Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 1 Oct 2022 19:33:04 +0200 Subject: [PATCH] suffix can have a none str value --- tiramisu/autolib.py | 4 +--- tiramisu/config.py | 12 ++++-------- tiramisu/option/syndynoptiondescription.py | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tiramisu/autolib.py b/tiramisu/autolib.py index aa563fc..1295758 100644 --- a/tiramisu/autolib.py +++ b/tiramisu/autolib.py @@ -279,9 +279,7 @@ async def manager_callback(callbk: Param, except ValueError as err: raise ValueError(_('the option "{0}" is used in a calculation but is invalid ({1})').format(option_bag.option.impl_get_display_name(), err)) except AttributeError as err: - raise ConfigError(_('impossible to calculate "{0}", {1}').format(option_bag.option.impl_get_display_name(), - err, - )) + raise ConfigError(_(f'unable to get value for calculating "{option_bag.option.impl_get_display_name()}", {err}')) return value async def get_option_bag(config_bag, diff --git a/tiramisu/config.py b/tiramisu/config.py index 09476e7..85000dc 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -106,7 +106,6 @@ class SubConfig: desc, resetted_opts, option_bag): - if option_bag.path in resetted_opts: return resetted_opts.append(option_bag.path) @@ -185,16 +184,13 @@ class SubConfig: context = self.cfgimpl_get_context() desc = context.cfgimpl_get_description() if option_bag is not None: - if 'cache' in option_bag.config_bag.properties: - has_cache = True - option_bag.config_bag.properties = option_bag.config_bag.properties - {'cache'} - else: - has_cache = False + if 'cache' not in option_bag.config_bag.properties: + return + option_bag.config_bag.properties = option_bag.config_bag.properties - {'cache'} await self.reset_one_option_cache(desc, resetted_opts, option_bag) - if has_cache: - option_bag.config_bag.properties = option_bag.config_bag.properties | {'cache'} + option_bag.config_bag.properties = option_bag.config_bag.properties | {'cache'} else: context._impl_values_cache.reset_all_cache() context._impl_properties_cache.reset_all_cache() diff --git a/tiramisu/option/syndynoptiondescription.py b/tiramisu/option/syndynoptiondescription.py index 408bcec..3d183f7 100644 --- a/tiramisu/option/syndynoptiondescription.py +++ b/tiramisu/option/syndynoptiondescription.py @@ -119,7 +119,7 @@ class SynDynOptionDescription: return rootpath + self.impl_getname() def impl_get_display_name(self) -> str: - return self.opt.impl_get_display_name() + self._suffix + return self.opt.impl_get_display_name() + str(self._suffix) class SynDynLeadership(SynDynOptionDescription):