From a6c4db6c2fedc8fa9ab9342a3ba206647ed672bb Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 26 Aug 2016 21:56:30 +0200 Subject: decorators: fix the case where there is no argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can’t believe we didn’t hit that before --- poezio/decorators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poezio/decorators.py b/poezio/decorators.py index 4891d5a5..87c9910e 100644 --- a/poezio/decorators.py +++ b/poezio/decorators.py @@ -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:] -- cgit v1.2.3