summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2008-05-08 10:34:39 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2008-05-08 10:34:39 (GMT)
commitc27b8b88e33e392444a05cce74da9080e3ae5b5b (patch)
treebbbcbf7c07db5e32706b9c9b07ac71d2e4436629
parent5a9fed75bd1c9da401004fd84c72437c1404a122 (diff)
downloadcpython-c27b8b88e33e392444a05cce74da9080e3ae5b5b.zip
cpython-c27b8b88e33e392444a05cce74da9080e3ae5b5b.tar.gz
cpython-c27b8b88e33e392444a05cce74da9080e3ae5b5b.tar.bz2
Fix for issue 1770190: platform.mac_ver() now returns the right
version on OSX 10.4.10
-rwxr-xr-xLib/platform.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index 2f01969..1dc8b27 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -722,7 +722,17 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
major = (sysv & 0xFF00) >> 8
minor = (sysv & 0x00F0) >> 4
patch = (sysv & 0x000F)
- release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
+
+ if (major, minor) >= (10, 4):
+ # the 'sysv' gestald cannot return patchlevels
+ # higher than 9. Apple introduced 3 new
+ # gestalt codes in 10.4 to deal with this
+ # issue (needed because patch levels can
+ # run higher than 9, such as 10.4.11)
+ major,minor,patch = _mac_ver_lookup(('sys1','sys2','sys3'))
+ release = '%i.%i.%i' %(major, minor, patch)
+ else:
+ release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
if sysu:
major = int((sysu & 0xFF000000L) >> 24)
minor = (sysu & 0x00F00000) >> 20