cmdutils: raise TypeError instead of ValueError.
This commit is contained in:
parent
ef31157f5e
commit
319ea242da
@ -222,8 +222,8 @@ class register: # pylint: disable=invalid-name
|
|||||||
type_conv = {}
|
type_conv = {}
|
||||||
signature = inspect.signature(self.func)
|
signature = inspect.signature(self.func)
|
||||||
if 'self' in signature.parameters and self.instance is None:
|
if 'self' in signature.parameters and self.instance is None:
|
||||||
raise ValueError("{} is a class method, but instance was not "
|
raise TypeError("{} is a class method, but instance was not "
|
||||||
"given!".format(self.name[0]))
|
"given!".format(self.name[0]))
|
||||||
has_count = 'count' in signature.parameters
|
has_count = 'count' in signature.parameters
|
||||||
doc = inspect.getdoc(self.func)
|
doc = inspect.getdoc(self.func)
|
||||||
if doc is not None:
|
if doc is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user