Unset __PYVENV_LAUNCHER__ to fix init_venv on OS X.
For some weird reason, pip installed logilab.common into /usr/local when launching it via subprocess, because __PYVENV_LAUNCHER__ was set...
This commit is contained in:
parent
dbd0d1fff9
commit
ddc4e7b309
@ -91,11 +91,15 @@ def venv_python(*args, output=False):
|
|||||||
"""Call the virtualenv's python with the given arguments."""
|
"""Call the virtualenv's python with the given arguments."""
|
||||||
subdir = 'Scripts' if os.name == 'nt' else 'bin'
|
subdir = 'Scripts' if os.name == 'nt' else 'bin'
|
||||||
executable = os.path.join(g_path, subdir, os.path.basename(sys.executable))
|
executable = os.path.join(g_path, subdir, os.path.basename(sys.executable))
|
||||||
|
env = dict(os.environ)
|
||||||
|
if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
|
||||||
|
# WORKAROUND for https://github.com/pypa/pip/issues/2031
|
||||||
|
del env['__PYVENV_LAUNCHER__']
|
||||||
if output:
|
if output:
|
||||||
return subprocess.check_output([executable] + list(args),
|
return subprocess.check_output([executable] + list(args),
|
||||||
universal_newlines=True)
|
universal_newlines=True, env=env)
|
||||||
else:
|
else:
|
||||||
subprocess.check_call([executable] + list(args))
|
subprocess.check_call([executable] + list(args), env=env)
|
||||||
|
|
||||||
|
|
||||||
def test_toolchain():
|
def test_toolchain():
|
||||||
|
Loading…
Reference in New Issue
Block a user