diff --git a/tiramisu/option.py b/tiramisu/option.py index 9dea2e9..acb9620 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -99,15 +99,15 @@ class Multi(list): if not self.opt._validate(value): raise ConfigError("invalid value {0} " "for option {1}".format(str(value), self.opt._name)) - if not isinstance(who, owners.Owner): - raise TypeError("invalid owner {0} for the value {1}".format( - str(who), str(value))) oldvalue = list(self) if key is None: ret = super(Multi, self).append(value) else: ret = super(Multi, self).__setitem__(key, value) if who != None: + if not isinstance(who, owners.Owner): + raise TypeError("invalid owner {0} for the value {1}".format( + str(who), str(value))) self.opt.setowner(self.config, getattr(owners, who)) self.config._cfgimpl_previous_values[self.opt._name] = oldvalue return ret