From e70054c4d4265bb77bcd5c085ce33cb16f4464ea Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 11 Dec 2012 16:22:02 +0100 Subject: [PATCH] owners for multi options --- tiramisu/option.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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