decorators: fix the case where there is no argument

can’t believe we didn’t hit that before
This commit is contained in:
mathieui 2016-08-26 21:56:30 +02:00
parent 7946190019
commit a6c4db6c2f

View file

@ -118,7 +118,10 @@ class CommandArgParser(object):
def first(func):
def second(self, args, *a, **kw):
default_args = defaults
args = common.shell_split(args)
if args and args.strip():
args = common.shell_split(args)
else:
args = []
if len(args) < mandatory:
return func(self, None, *a, **kw)
res, args = args[:mandatory], args[mandatory:]