From 39c8e2eb0b97ae4b8d8f7dbd60fc2ce75e946d54 Mon Sep 17 00:00:00 2001 From: Garette Emmanuel Date: Mon, 25 Mar 2013 11:45:21 +0100 Subject: [PATCH] add import and name => opt._name --- tiramisu/value.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tiramisu/value.py b/tiramisu/value.py index db3b8f8..4ebc073 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -20,7 +20,8 @@ # the rough pypy's guys: http://codespeak.net/svn/pypy/dist/pypy/config/ # the whole pypy projet is under MIT licence # ____________________________________________________________ -from tiramisu.error import NoValueReturned, MandatoryError, MultiTypeError +from tiramisu.error import NoValueReturned, MandatoryError, MultiTypeError, \ + ConfigError from tiramisu.setting import owners, multitypes class Values(object): @@ -161,12 +162,12 @@ class Values(object): # this result **shall not** be a list if isinstance(result, list): raise ConfigError('invalid calculated value returned ' - 'for option {0} : shall not be a list'.format(name)) + 'for option {0} : shall not be a list'.format(opt._name)) value = result if value != None and not opt.validate(value, self.context._cfgimpl_settings.validator): raise ConfigError('invalid calculated value returned' - ' for option {0}'.format(name)) + ' for option {0}'.format(opt._name)) # frozen and force default if not opt.has_callback() and opt.is_forced_on_freeze(): value = opt.getdefault()