From 05200b6d5c28ee27adc9a487dd5496a514e12e01 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 21 Nov 2016 18:49:04 +0100 Subject: [PATCH] display_name could be not unique --- tiramisu/option/baseoption.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 95cf9bf..091d46a 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -797,23 +797,25 @@ class Option(OnlyOption): for opt_ in [opts[idx_inf], opts[idx_inf + idx_sup + 1]]: if opt_ == current_opt: is_current = True - equal.add('"{}"'.format(opt_.impl_get_display_name())) + else: + equal.add(opt_) if equal: if debug: log.debug(_('_cons_not_equal: {} are not different').format(display_list(list(equal)))) if is_current: - equal.remove('"' + current_opt.impl_get_display_name() + '"') if warnings_only: msg = _('should be different from the value of {}') else: msg = _('must be different from the value of {}') - return ValueError(msg.format(display_list(list(equal)))) else: if warnings_only: msg = _('value for {} should be different') else: msg = _('value for {} must be different') - return ValueError(msg.format(display_list(list(equal)))) + equal_name = [] + for opt in equal: + equal_name.append(opt.impl_get_display_name()) + return ValueError(msg.format(display_list(list(equal_name)))) # serialize/unserialize def _impl_convert_consistencies(self, descr, load=False):