python: fix sysconfig.get_platform when run in a mingw shell

In a mingw shell it will call os.uname() which starts with MINGW..
resulting in bogus results. So just check for sys.platform which
is always "cygwin".

See #5143
This commit is contained in:
Christoph Reiter
2025-02-01 17:44:25 +01:00
parent afbebffc27
commit 08eb9bd35a
2 changed files with 4 additions and 4 deletions

View File

@@ -45,13 +45,13 @@
else:
print(cdll.LoadLibrary("libm.so"))
--- Python-3.12.8/Lib/sysconfig.py.orig 2024-12-03 19:42:41.000000000 +0100
+++ Python-3.12.8/Lib/sysconfig.py 2025-01-24 20:14:10.834146500 +0100
+++ Python-3.12.8/Lib/sysconfig.py 2025-02-01 17:39:28.925188300 +0100
@@ -815,13 +815,13 @@
elif osname[:3] == "aix":
from _aix_support import aix_platform
return aix_platform()
- elif osname[:6] == "cygwin":
+ elif osname[:6] == "cygwin" or osname[:4] == "msys":
+ elif sys.platform == "cygwin":
+ # https://github.com/msys2/MSYS2-packages/issues/5143
+ # Various build tools use the platform to derive the wheel tag
+ # and the wheel tag needs to be stable for a specific platform