https://github.com/python/cpython/commit/b5c7c84673b96bfdd7c877521a970f7a4beafece
commit: b5c7c84673b96bfdd7c877521a970f7a4beafece
branch: main
author: Aiden Fox Ivey <[email protected]>
committer: ronaldoussoren <[email protected]>
date: 2024-01-26T21:36:50+01:00
summary:

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]>

files:
A Misc/NEWS.d/next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst
M Lib/platform.py

diff --git a/Lib/platform.py b/Lib/platform.py
index 75aa55510858fd..b56472235ee9e4 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -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:
diff --git 
a/Misc/NEWS.d/next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst 
b/Misc/NEWS.d/next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst
new file mode 100644
index 00000000000000..abd296f8608518
--- /dev/null
+++ b/Misc/NEWS.d/next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst
@@ -0,0 +1 @@
+Add Mach-O linkage support for :func:`platform.architecture()`.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to