From f0bacb8d86fa154a4b1cf2e76185f96e0b231e6c Mon Sep 17 00:00:00 2001 From: Dan Yeaw Date: Sat, 20 Feb 2021 22:10:15 -0500 Subject: [PATCH] utils/envs: fix envs in MSYS2 always broken Fixes #2867, the virtual environment found seems to be broken messages when running in MSYS2. This change detects when in MSYS2 in order to use the bin directory for the virtualenv instead of Scripts which is normally used in Windows. --- poetry/utils/env.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/poetry/utils/env.py b/poetry/utils/env.py index ff78bf0161b..cde68025be5 100644 --- a/poetry/utils/env.py +++ b/poetry/utils/env.py @@ -879,9 +879,13 @@ class Env(object): def __init__(self, path: Path, base: Optional[Path] = None) -> None: self._is_windows = sys.platform == "win32" + self._is_mingw = sysconfig.get_platform() == "mingw" + if not self._is_windows or self._is_mingw: + bin_dir = "bin" + else: + bin_dir = "Scripts" self._path = path - bin_dir = "bin" if not self._is_windows else "Scripts" self._bin_dir = self._path / bin_dir self._base = base or path