From 7d41a8b3ce3eac4a00c37996bc1c08e6378632b8 Mon Sep 17 00:00:00 2001 From: s0600204 Date: Fri, 3 Sep 2021 09:32:21 +0100 Subject: [PATCH] Fix oversight in #3713 When running `python` within the various shells made available on Windows by MSys2, `sysconfig.get_platform()` returns: * MSys2 : `msys-3.2.0-x86-64` * MinGW x32 : `mingw_i686` * MinGW x64 : `mingw_x86_64` * MinGW UCRT64 : `mingw_x86_64_ucrt` * MinGW Clang64 : `mingw_x86_64_clang` In the case that `sysconfig.get_platform()` *does* return `mingw` (with no suffix), this change should still work as expected. --- poetry/utils/env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/utils/env.py b/poetry/utils/env.py index fb4c2021747..631c06cc537 100644 --- a/poetry/utils/env.py +++ b/poetry/utils/env.py @@ -1047,7 +1047,7 @@ class Env: def __init__(self, path: Path, base: Optional[Path] = None) -> None: self._is_windows = sys.platform == "win32" - self._is_mingw = sysconfig.get_platform() == "mingw" + self._is_mingw = sysconfig.get_platform().startswith("mingw") if not self._is_windows or self._is_mingw: bin_dir = "bin"