Commit ee67aa8c by s0600204 Committed by GitHub

utils/env: improve migw detection on windows

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.

Related-to: #3713
parent aabf9d93
......@@ -1085,7 +1085,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"
......
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