summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-05 21:41:52 (GMT)
committerGitHub <noreply@github.com>2018-12-05 21:41:52 (GMT)
commitea0ca218b0c28b2af2b1f6a5d3383569de7fc2c1 (patch)
treea24104d328f8f9288fe7bef507eff49cb25a80e1 /Lib/platform.py
parent40a61da40d252626f8b9ff524d76c1f0ccb3a4f7 (diff)
downloadcpython-ea0ca218b0c28b2af2b1f6a5d3383569de7fc2c1.zip
cpython-ea0ca218b0c28b2af2b1f6a5d3383569de7fc2c1.tar.gz
cpython-ea0ca218b0c28b2af2b1f6a5d3383569de7fc2c1.tar.bz2
bpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)
On macOS, platform.platform() now uses mac_ver(), if it returns a non-empty release string, to get the macOS version rather than darwin version.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index f089a46..d845525 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1182,6 +1182,14 @@ def platform(aliased=0, terse=0):
if aliased:
system, release, version = system_alias(system, release, version)
+ if system == 'Darwin':
+ # macOS (darwin kernel)
+ macos_release = mac_ver()[0]
+ if macos_release:
+ # note: 'macOS' is different than 'MacOS' used below
+ system = 'macOS'
+ release = macos_release
+
if system == 'Windows':
# MS platforms
rel, vers, csd, ptype = win32_ver(version)