command: Fix handling of count when it's not given.
This commit is contained in:
parent
b2058e2f0e
commit
f1f05516b3
@ -147,9 +147,13 @@ class Command:
|
||||
"which does not support count!".format(
|
||||
self.name))
|
||||
if param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD:
|
||||
posargs.append(count)
|
||||
if count is not None:
|
||||
posargs.append(count)
|
||||
else:
|
||||
posargs.append(param.default)
|
||||
elif param.kind == inspect.Parameter.KEYWORD_ONLY:
|
||||
kwargs['count'] = count
|
||||
if count is not None:
|
||||
kwargs['count'] = count
|
||||
else:
|
||||
raise TypeError("{}: invalid parameter type {} for "
|
||||
"argument 'count'!".format(
|
||||
|
Loading…
Reference in New Issue
Block a user