diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-05 23:41:04 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-05 23:41:04 +0200 |
commit | 93a989f7040539ca9d928d635169a0df9ba20b43 (patch) | |
tree | 51d43d4af521e338117a1fab673e471f7784a10d | |
parent | ac81153b664e468428bb9c550dbea03d3087f8cc (diff) | |
download | psutil-93a989f7040539ca9d928d635169a0df9ba20b43.tar.gz |
make.bat: have subprocesses inherit cwd and environ
-rwxr-xr-x | scripts/internal/winmake.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index e813f33c..aaeaeed5 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -24,8 +24,8 @@ import sys import tempfile -PYTHON = sys.executable -TSCRIPT = os.environ['TSCRIPT'] +PYTHON = os.getenv('PYTHON', sys.executable) +TSCRIPT = os.getenv('TSCRIPT', 'psutil\\tests\\__main__.py') GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" PY3 = sys.version_info[0] == 3 DEPS = [ @@ -77,9 +77,7 @@ def safe_print(text, file=sys.stdout, flush=False): def sh(cmd, nolog=False): if not nolog: safe_print("cmd: " + cmd) - code = os.system(cmd) - if code: - raise SystemExit + subprocess.check_call(cmd, shell=True, env=os.environ, cwd=os.getcwd()) def cmd(fun): @@ -457,6 +455,7 @@ def set_python(s): if os.path.isfile(path): print(path) PYTHON = path + os.putenv('PYTHON', path) return return sys.exit( "can't find any python installation matching %r" % orig) |