Commit 47c63b24 by Sébastien Eustace

Try another approach for call to venv binaries

parent f406146f
......@@ -195,20 +195,27 @@ class Venv:
"""
Run a command inside the virtual env.
"""
cmd = [self._bin(bin)] + list(args)
cmd = [bin] + list(args)
shell = kwargs.get('shell', False)
try:
if shell:
cmd = ' '.join(cmd)
try:
if not self.is_venv():
output = subprocess.check_output(cmd, **kwargs)
else:
if self._windows:
kwargs['shell'] = True
output = subprocess.check_output(
cmd, stderr=subprocess.STDOUT,
**kwargs
)
with self.temp_environ():
os.environ['PATH'] = self._path()
os.environ['VIRTUAL_ENV'] = str(self._venv)
self.unset_env('PYTHONHOME')
self.unset_env('__PYVENV_LAUNCHER__')
output = subprocess.check_output(cmd, **kwargs)
except CalledProcessError as e:
raise VenvCommandError(e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment