From 050bfd29f7f3746051f8de5094bc7930cc01290f Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 20 Nov 2019 12:03:02 +0000 Subject: [PATCH] args_split shouldn't be [""] when `args` is empty --- modules/commands/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 9048fb8d..112a85b0 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -102,11 +102,12 @@ class Module(ModuleManager.BaseModule): hook = potential_hook - argparse = hook.get_kwarg("argparse", "plain") - if argparse == "shlex": - args_split = shlex.split(args) - elif argparse == "plain": - args_split = args.split(" ") + if args: + argparse = hook.get_kwarg("argparse", "plain") + if argparse == "shlex": + args_split = shlex.split(args) + elif argparse == "plain": + args_split = args.split(" ") break