From 895bfae82deb3de96043c9f8d89d02a5afe696e1 Mon Sep 17 00:00:00 2001 From: Alessandro ZANNI Date: Fri, 29 Jul 2016 22:42:06 +0200 Subject: [PATCH] fix shell_exec issue --- pupy/modules/lib/utils/shell_exec.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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: