From 957581b4b753ef416a0318e0f0c1692328625c12 Mon Sep 17 00:00:00 2001 From: Aiden Fox Ivey Date: Fri, 26 Jan 2024 15:36:50 -0500 Subject: [PATCH] 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 --- Lib/platform.py | 2 ++ .../next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst | 1 + 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/macOS/2024-01-23-11-35-26.gh-issue-114490.FrQOQ0.rst diff --git a/Lib/platform.py b/Lib/platform.py index 75aa55510858fd4..b56472235ee9e42 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 000000000000000..abd296f86085180 --- /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()`.