Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5c7c84

Browse files
Aiden Fox Iveyaisk
andauthored
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 <[email protected]>
1 parent 07236f5 commit b5c7c84

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/platform.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ def architecture(executable=sys.executable, bits='', linkage=''):
752752
# Linkage
753753
if 'ELF' in fileout:
754754
linkage = 'ELF'
755+
elif 'Mach-O' in fileout:
756+
linkage = "Mach-O"
755757
elif 'PE' in fileout:
756758
# E.g. Windows uses this format
757759
if 'Windows' in fileout:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Mach-O linkage support for :func:`platform.architecture()`.

0 commit comments

Comments
 (0)