gh-114490: Add check for Mach-O linkage in Lib/platform.py (#114491)

``platform.architecture()`` now returns the format of binaries (e.g. Mach-O) instead of the default empty string.

Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
Aiden Fox Ivey 2024-01-26 15:36:50 -05:00 committed by GitHub
parent 07236f5b39
commit b5c7c84673
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -752,6 +752,8 @@ def architecture(executable=sys.executable, bits='', linkage=''):
# Linkage
if 'ELF' in fileout:
linkage = 'ELF'
elif 'Mach-O' in fileout:
linkage = "Mach-O"
elif 'PE' in fileout:
# E.g. Windows uses this format
if 'Windows' in fileout: