Skip to content

Commit

Permalink
pythongh-114490: Add check for Mach-O linkage in Lib/platform.py (pyt…
Browse files Browse the repository at this point in the history
…hon#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>
  • Loading branch information
aidenfoxivey and aisk committed Feb 11, 2024
1 parent 731cd23 commit 957581b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/platform.py
Expand Up @@ -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:
Expand Down
@@ -0,0 +1 @@
Add Mach-O linkage support for :func:`platform.architecture()`.

0 comments on commit 957581b

Please sign in to comment.