summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-11-20 13:04:38 +0100
committerCarl Hetherington <cth@carlh.net>2020-11-20 13:04:38 +0100
commit1929c5d0df545dddb8e78779b09e9f6c5b25e9f5 (patch)
treeb2b86da82dcb198540a6cb56466e7c5fa1d21edc
parentd0d369e34fa1767889ec817315e909c2db081ad9 (diff)
Also we need to specify posix to shlex.split to avoid it removing backslashes.
-rwxr-xr-xcdist3
1 files changed, 2 insertions, 1 deletions
diff --git a/cdist b/cdist
index 516dcad..10bed90 100755
--- a/cdist
+++ b/cdist
@@ -256,8 +256,9 @@ def rmtree(a):
def command(c):
log_normal(c)
+ posix = sys.platform != 'win32'
try:
- r = subprocess.run(shlex.split(c), shell=True)
+ r = subprocess.run(shlex.split(c, posix=posix), shell=True)
if r.returncode != 0:
raise Error(f'command {c} failed ({r.returncode})')
except Exception as e: