diff options
Diffstat (limited to 'mitmproxy/tools/console/command.py')
-rw-r--r-- | mitmproxy/tools/console/command.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mitmproxy/tools/console/command.py b/mitmproxy/tools/console/command.py index e6eabf3a..4cb4fe6d 100644 --- a/mitmproxy/tools/console/command.py +++ b/mitmproxy/tools/console/command.py @@ -1,6 +1,6 @@ import urwid -from mitmproxy import command +from mitmproxy import exceptions from mitmproxy.tools.console import signals @@ -17,10 +17,11 @@ class CommandExecutor: self.master = master def __call__(self, cmd): - try: - ret = self.master.commands.call(cmd) - except command.CommandError as v: - signals.status_message.send(message=str(v)) - else: - if type(ret) == str: - signals.status_message.send(message=ret) + if cmd.strip(): + try: + ret = self.master.commands.call(cmd) + except exceptions.CommandError as v: + signals.status_message.send(message=str(v)) + else: + if type(ret) == str: + signals.status_message.send(message=ret) |