Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Lib/sysconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,17 @@ def get_platform():

For other non-POSIX platforms, currently just returns :data:`sys.platform`."""
if os.name == 'nt':
# Check for architecture in sys.version first, then fall back to sys.maxsize
# which is reliable even when sys.version is truncated (e.g., clang builds on Windows)
if 'amd64' in sys.version.lower():
return 'win-amd64'
if '(arm)' in sys.version.lower():
return 'win-arm32'
if sys.maxsize > 2**32:
# 64-bit Windows where sys.version may be truncated
return 'win-amd64'
if '(arm64)' in sys.version.lower():
return 'win-arm64'
if '(arm)' in sys.version.lower():
return 'win-arm32'
return sys.platform

if os.name != "posix" or not hasattr(os, 'uname'):
Expand Down
Loading