From b2538f6f0bc593f3bf7596299ba830d7dfccf9d3 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 11 Jun 2013 15:31:20 +0200 Subject: [PATCH] support of non multi variable --- tiramisu/value.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tiramisu/value.py b/tiramisu/value.py index 9e65db2..e90e59c 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -121,7 +121,7 @@ class Values(object): (is_frozen and 'force_default_on_freeze' in setting[opt])): no_value_slave = False - if opt.impl_get_multitype() == multitypes.slave: + if opt.impl_is_multi() and opt.impl_get_multitype() == multitypes.slave: masterp = self.context.cfgimpl_get_description().impl_get_path_by_opt( opt.impl_get_master_slaves()) mastervalue = getattr(self.context, masterp) @@ -132,13 +132,12 @@ class Values(object): if not no_value_slave: value = self._getcallback_value(opt) - if opt.impl_is_multi(): - if opt.impl_get_multitype() == multitypes.slave: - if isinstance(value, list): - raise ValueError('callback must not return list ' - 'in slave {0}: {1}'.format(opt._name, - value)) - value = [value for i in range(lenmaster)] + if opt.impl_is_multi() and opt.impl_get_multitype() == multitypes.slave: + if isinstance(value, list): + raise ValueError('callback must not return list ' + 'in slave {0}: {1}'.format(opt._name, + value)) + value = [value for i in range(lenmaster)] if opt.impl_is_multi(): value = Multi(value, self.context, opt, validate) #suppress value if already set