From 32b24c29781267672ed71560d943f82f3a7839d2 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 4 Nov 2023 08:28:54 +0100 Subject: [PATCH] better error message --- tiramisu/option/dynoptiondescription.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tiramisu/option/dynoptiondescription.py b/tiramisu/option/dynoptiondescription.py index e71e5e0..07b294e 100644 --- a/tiramisu/option/dynoptiondescription.py +++ b/tiramisu/option/dynoptiondescription.py @@ -111,13 +111,9 @@ class DynOptionDescription(OptionDescription): self.impl_get_display_name())) else: values_.append(val) - if __debug__: - if len(values_) > len(set(values_)): - extra_values = values_.copy() - for val in set(values_): - extra_values.remove(val) - raise ValueError(_('DynOptionDescription suffixes return a list with ' - f'multiple value "{extra_values}"''')) + if __debug__ and len(values_) > len(set(values_)): + raise ValueError(_(f'DynOptionDescription "{self._name}" suffixes return a list with ' + f'same values "{values_}"''')) return values_ def impl_is_dynoptiondescription(self) -> bool: