aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 22:26:59 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 22:26:59 +0200
commitf9142e00b3078e8583661dc94258e02276f18fa9 (patch)
treec3fd5e87df6cc957c277f6b1f95077fd2ab03310
parentc379f051d3b45e306f628f0764ab781f20e0f8f4 (diff)
downloadmgarepo-f9142e00b3078e8583661dc94258e02276f18fa9.tar
mgarepo-f9142e00b3078e8583661dc94258e02276f18fa9.tar.gz
mgarepo-f9142e00b3078e8583661dc94258e02276f18fa9.tar.bz2
mgarepo-f9142e00b3078e8583661dc94258e02276f18fa9.tar.xz
mgarepo-f9142e00b3078e8583661dc94258e02276f18fa9.zip
handle lists as argument for execcmd
-rw-r--r--MgaRepo/util.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/MgaRepo/util.py b/MgaRepo/util.py
index 18759aa..ff71ce7 100644
--- a/MgaRepo/util.py
+++ b/MgaRepo/util.py
@@ -25,10 +25,13 @@ def execcmd(*cmd, **kwargs):
assert (kwargs.get("collecterr") and kwargs.get("show")) or not kwargs.get("collecterr"), \
("execcmd is implemented to handle collecterr=True only if show=True")
# split command args
- if isinstance(cmd[0], str) and len(cmd) is 1:
- cmdargs = shlex.split(cmd[0])
+ if isinstance(cmd[0], str):
+ if len(cmd) is 1:
+ cmdargs = shlex.split(cmd[0])
+ else:
+ cmdargs = cmd[:]
else:
- cmdargs = cmd[:]
+ cmdargs = cmd[0][:]
stdout = None
stderr = None