Skip to content

Commit

Permalink
distutils: Change the get_platform() method in distutils to match s…
Browse files Browse the repository at this point in the history
…ysconfig

This would possibly fix building wheels when mingw python
is used and would be unique to each python same as EXT_SUFFIX.

Signed-off-by: Naveen M K <[email protected]>
  • Loading branch information
naveen521kk authored and lazka committed Jul 19, 2023
1 parent 9dba083 commit bac123a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Lib/distutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,20 @@ def get_host_platform():
"""
if os.name == 'nt':
if 'GCC' in sys.version:
return 'mingw'
if 'gcc' in sys.version.lower():
if 'ucrt' in sys.version.lower():
if 'amd64' in sys.version.lower():
return 'mingw_x86_64_ucrt'
return 'mingw_i686_ucrt'
if 'clang' in sys.version.lower():
if 'amd64' in sys.version.lower():
return 'mingw_x86_64_clang'
if 'arm64' in sys.version.lower():
return 'mingw_aarch64'
return 'mingw_i686_clang'
if 'amd64' in sys.version.lower():
return 'mingw_x86_64'
return 'mingw_i686'
if 'amd64' in sys.version.lower():
return 'win-amd64'
if '(arm)' in sys.version.lower():
Expand Down

0 comments on commit bac123a

Please sign in to comment.