From e223617a78df721ce47e88299d1e8700102ab7c0 Mon Sep 17 00:00:00 2001 From: Florian Fischer <florian.fl.fischer@fau.de> Date: Fri, 13 Dec 2019 16:17:19 +0100 Subject: [PATCH] add subprocess.run shell parameter to run_cmd --- src/util.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util.py b/src/util.py index c5074b6..04a4a0c 100644 --- a/src/util.py +++ b/src/util.py @@ -27,6 +27,7 @@ import src.globalvars def run_cmd(cmd, output_verbosity=3, capture=False, + shell=False, check=True, cwd=None, input=None): @@ -42,12 +43,13 @@ def run_cmd(cmd, stderr = stdout return subprocess.run(cmd, - check=check, - universal_newlines=True, - cwd=None, stdout=stdout, stderr=stderr, - input=input) + shell=shell, + check=check, + input=input, + cwd=cwd, + universal_newlines=True) def is_exe(fpath): @@ -85,7 +87,7 @@ def prefix_cmd_with_abspath(cmd): binary_end = None if binary_end == -1 else binary_end binary_abspath = run_cmd(["whereis", cmd[0:binary_end]], - capture=True).stdout + capture=True).stdout binary_abspath = binary_abspath.split()[1] # add arguments of cmd to the abspath -- GitLab