Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -1917,3 +1917,4 @@ def _find_incompatible_extension_module(module_name):
for entry in traversable.iterdir():
if entry.name.startswith(child + '.') and entry.name.endswith(untagged_suffix):
return entry.name
# typo fix