summaryrefslogtreecommitdiff
path: root/tools/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util.py')
-rw-r--r--tools/util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/util.py b/tools/util.py
index 8a65f2ede..4141396df 100644
--- a/tools/util.py
+++ b/tools/util.py
@@ -3,6 +3,8 @@
import os
import subprocess
+executable_suffix = ".exe" if os.name == "nt" else ""
+
def run(args, quiet=False, envs={}):
if not quiet:
@@ -10,10 +12,9 @@ def run(args, quiet=False, envs={}):
env = os.environ.copy()
for key in envs.keys():
env[key] = envs[key]
- if os.name == "nt":
- # Run through shell to make .bat/.cmd files work.
- args = ["cmd", "/c"] + args
- subprocess.check_call(args, env=env)
+ args[0] = os.path.normpath(args[0])
+ shell = os.name == "nt" # Run through shell to make .bat/.cmd files work.
+ subprocess.check_call(args, env=env, shell=shell)
def remove_and_symlink(target, name, target_is_dir=False):