Skip to content

Commit e53aa5d

Browse files
committed
Do not truncate compiler versions generated by PC/pyconfig.h
1 parent 8431d21 commit e53aa5d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎Lib/test/test_tools/test_getbuildinfo.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ def check_unchanged(compiler):
141141
check('Custom Vendor (something) Clang 22.1.0+dev',
142142
'Custom Vendor Clang 22.1.0+dev')
143143

144+
check_unchanged('Clang 22.1.3 64 bit (AMD64) with MSC v.1951 CRT')
144145
check_unchanged('GCC 16.2.1 20260819 (Red Hat 16.2.1-2)')
145146
check_unchanged('GCC 15.2.0')
147+
check_unchanged('MSC v.1951 64 bit (AMD64)')
146148
check_unchanged('MSC v.1951 32 bit (Intel)')
147149

148150
with support.captured_stdout() as stdout:

‎Tools/build/generate_getbuildinfo.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,17 @@ def _get_compiler():
182182

183183

184184
def compact_compiler(compiler):
185+
if '64 bit (AMD64)' in compiler:
186+
# On Windows, the '64 bit (AMD64)' pattern is expected by multiple
187+
# tools such as sysconfig.get_platform() and ctypes.util.find_msvcrt().
188+
# Example: 'MSC v.1951 64 bit (AMD64)'.
189+
return compiler
190+
if ' with MSC v' in compiler:
191+
# Do not truncate "Clang with MSC" version:
192+
# ''Clang 22.1.3 64 bit (AMD64) with MSC v.1951 CRT'
193+
return compiler
194+
195+
# Truncate long Clang version (ex: strip long URL)
185196
match = CLANG_VERSION_REGEX.search(compiler)
186197
if match:
187198
vendor = match.group(1)

0 commit comments

Comments
 (0)