Unverified Commit 47c63b24 authored by Sébastien Eustace's avatar Sébastien Eustace
Browse files

Try another approach for call to venv binaries

parent f406146f
Loading
Loading
Loading
Loading
+13 −6
Changes for poetry/utils/venv.py: 13 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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)