Commit 47c63b24 by Sébastien Eustace

Try another approach for call to venv binaries

parent f406146f
...@@ -195,20 +195,27 @@ class Venv: ...@@ -195,20 +195,27 @@ class Venv:
""" """
Run a command inside the virtual env. Run a command inside the virtual env.
""" """
cmd = [self._bin(bin)] + list(args) cmd = [bin] + list(args)
shell = kwargs.get('shell', False) shell = kwargs.get('shell', False)
if shell:
cmd = ' '.join(cmd)
try: try:
if shell: if not self.is_venv():
cmd = ' '.join(cmd) output = subprocess.check_output(cmd, **kwargs)
else:
if self._windows:
kwargs['shell'] = True
with self.temp_environ():
os.environ['PATH'] = self._path()
os.environ['VIRTUAL_ENV'] = str(self._venv)
if self._windows: self.unset_env('PYTHONHOME')
kwargs['shell'] = True self.unset_env('__PYVENV_LAUNCHER__')
output = subprocess.check_output( output = subprocess.check_output(cmd, **kwargs)
cmd, stderr=subprocess.STDOUT,
**kwargs
)
except CalledProcessError as e: except CalledProcessError as e:
raise VenvCommandError(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