diff --git a/pupy/modules/lib/utils/shell_exec.py b/pupy/modules/lib/utils/shell_exec.py index e98666e1..c38e5995 100644 --- a/pupy/modules/lib/utils/shell_exec.py +++ b/pupy/modules/lib/utils/shell_exec.py @@ -6,8 +6,6 @@ import subprocess def shell_exec(client, cmdline, shell=None): """ cmdline can be either a list of arguments or a string """ - if type(cmdline) is not list: - cmdline=cmdline.split() res="" try: if client.is_android(): @@ -17,9 +15,9 @@ def shell_exec(client, cmdline, shell=None): res=client.conn.modules.subprocess.check_output(cmdline, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, shell=True, universal_newlines=True) else: if client.is_windows(): - command=[shell, '/c'] + cmdline + command=[shell, '/c', cmdline] else: - command=[shell, '-c'] + cmdline + command=[shell, '-c', cmdline] res=client.conn.modules.subprocess.check_output(command, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, universal_newlines=True) except Exception as e: if hasattr(e,'output') and e.output: