Commit 56543796 by Sébastien Eustace

Add a small fix for virtual envs pointing at a base Python install

parent 442ff521
......@@ -723,6 +723,19 @@ class Env(object):
"""
bin_path = (self._bin_dir / bin).with_suffix(".exe" if self._is_windows else "")
if not bin_path.exists():
# On Windows, some executables can be in the base path
# This is especially true when installing Python with
# the official installer, where python.exe will be at
# the root of the env path.
# This is an edge case and should not be encountered
# in normal uses but this happens in the sonnet script
# that creates a fake virtual environment pointing to
# a base Python install.
if self._is_windows:
bin_path = (self._path / bin).with_suffix(".exe")
if bin_path.exists():
return str(bin_path)
return bin
return str(bin_path)
......
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