Skip to content

Commit

Permalink
make.bat: have subprocesses inherit cwd and environ
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 5, 2017
1 parent ac81153 commit 93a989f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/internal/winmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
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 = [
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 93a989f

Please sign in to comment.