summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-26 21:56:30 +0200
committermathieui <mathieui@mathieui.net>2016-08-26 21:56:30 +0200
commita6c4db6c2fedc8fa9ab9342a3ba206647ed672bb (patch)
tree2afaf1a3ed5f5078cf5bc8169b9abd83b0add5e0
parent7946190019de95353a5adbabc9bb1807c01ff0e9 (diff)
downloadpoezio-a6c4db6c2fedc8fa9ab9342a3ba206647ed672bb.tar.gz
poezio-a6c4db6c2fedc8fa9ab9342a3ba206647ed672bb.tar.bz2
poezio-a6c4db6c2fedc8fa9ab9342a3ba206647ed672bb.tar.xz
poezio-a6c4db6c2fedc8fa9ab9342a3ba206647ed672bb.zip
decorators: fix the case where there is no argument
can’t believe we didn’t hit that before
-rw-r--r--poezio/decorators.py5
1 files changed, 4 insertions, 1 deletions
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:]