command: Check for handlers with count and no default.
This commit is contained in:
parent
e2763da8d6
commit
1a00d6168c
@ -174,6 +174,10 @@ class Command:
|
|||||||
name_conv = {}
|
name_conv = {}
|
||||||
signature = inspect.signature(self.handler)
|
signature = inspect.signature(self.handler)
|
||||||
has_count = 'count' in signature.parameters
|
has_count = 'count' in signature.parameters
|
||||||
|
if has_count and (signature.parameters['count'].default is
|
||||||
|
inspect.Parameter.empty):
|
||||||
|
raise TypeError("{}: handler has count parameter without "
|
||||||
|
"default!".format(self.name))
|
||||||
doc = inspect.getdoc(self.handler)
|
doc = inspect.getdoc(self.handler)
|
||||||
if doc is not None:
|
if doc is not None:
|
||||||
desc = doc.splitlines()[0].strip()
|
desc = doc.splitlines()[0].strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user