diff options
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/constants.py | 2 | ||||
-rw-r--r-- | ipalib/parameter.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ipalib/constants.py b/ipalib/constants.py index d028a0013..ad1e3f7cb 100644 --- a/ipalib/constants.py +++ b/ipalib/constants.py @@ -26,7 +26,7 @@ All constants centralised in one file. NULLS = (None, '', u'', tuple(), []) -TYPE_ERROR = '%s: need a %r; got %r (a %r)' +TYPE_ERROR = '%s: need a %r; got %r (which is a %r)' CALLABLE_ERROR = '%s: need a callable; got %r (a %r)' diff --git a/ipalib/parameter.py b/ipalib/parameter.py index a80c43c4d..ca578cd98 100644 --- a/ipalib/parameter.py +++ b/ipalib/parameter.py @@ -161,10 +161,12 @@ def parse_param_spec(spec): :param spec: A spec string. """ if type(spec) is not str: - raise_TypeError(spec, str, 'spec') + raise TypeError( + TYPE_ERROR % ('spec', str, spec, type(spec)) + ) if len(spec) < 2: raise ValueError( - 'param spec must be at least 2 characters; got %r' % spec + 'spec must be at least 2 characters; got %r' % spec ) _map = { '?': dict(required=False, multivalue=False), |