From 793e0068262a714fb807cca1ca4b22324db3bc2f Mon Sep 17 00:00:00 2001 From: Daniel Van Der Maden Date: Fri, 28 Feb 2020 15:51:59 -0800 Subject: [PATCH] [cli] Clean cli calls to account for empty strings --- pyhmy/_version.py | 2 +- pyhmy/cli.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyhmy/_version.py b/pyhmy/_version.py index 32609b9..8feade6 100644 --- a/pyhmy/_version.py +++ b/pyhmy/_version.py @@ -7,5 +7,5 @@ Provides pyhmy version information. from incremental import Version -__version__ = Version('pyhmy', 20, 1, 24) +__version__ = Version('pyhmy', 20, 1, 25) __all__ = ["__version__"] diff --git a/pyhmy/cli.py b/pyhmy/cli.py index aaa7f81..1b2393e 100644 --- a/pyhmy/cli.py +++ b/pyhmy/cli.py @@ -275,7 +275,7 @@ def single_call(command, timeout=60, error_ok=False): :returns: Decoded string of response from hmy CLI call :raises: RuntimeError if bad command """ - command_toks = command.split(" ") + command_toks = [el for el in command.split(" ") if el] if re.match(".*hmy", command_toks[0]): command_toks = command_toks[1:] command_toks = [_binary_path] + command_toks @@ -295,7 +295,7 @@ def expect_call(command, timeout=60): :returns: A pexpect child program :raises: RuntimeError if bad command """ - command_toks = command.split(" ") + command_toks = [el for el in command.split(" ") if el] if re.match(".*hmy", command_toks[0]): command_toks = command_toks[1:] try: