summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2008-05-18 20:54:47 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2008-05-18 20:54:47 (GMT)
commit7a0f4c75b1d2e3ceb758970ad39d468e95dfc6ed (patch)
tree1804777b3b92bdedb3d9ac5cad9cb71da2e91151 /Lib/platform.py
parentf5c38dadf6b60839812fa450091cbbbed0a42655 (diff)
downloadcpython-7a0f4c75b1d2e3ceb758970ad39d468e95dfc6ed.zip
cpython-7a0f4c75b1d2e3ceb758970ad39d468e95dfc6ed.tar.gz
cpython-7a0f4c75b1d2e3ceb758970ad39d468e95dfc6ed.tar.bz2
- Add unittests for platform.mac_ver (or rather, ensure that the unittest for
that function actually tests something on OSX). - Add documentation to platform.mac_ver that explains why the middle element of the return value will not contain useful information.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index 1dc8b27..e0e710b 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -733,7 +733,11 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
release = '%i.%i.%i' %(major, minor, patch)
else:
release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
+
if sysu:
+ # NOTE: this block is left as documentation of the
+ # intention of this function, the 'sysu' gestalt is no
+ # longer available and there are no alternatives.
major = int((sysu & 0xFF000000L) >> 24)
minor = (sysu & 0x00F00000) >> 20
bugfix = (sysu & 0x000F0000) >> 16
@@ -746,6 +750,8 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
0x60:'beta',
0x80:'final'}.get(stage,'')
versioninfo = (version,stage,nonrel)
+
+
if sysa:
machine = {0x1: '68k',
0x2: 'PowerPC',