[Pythonmac-SIG] how to determine Mac OS X version

Jim Tittsler jwt at onjapan.net
Fri May 28 07:23:25 EDT 2004


On May 28, 2004, at 18:03, Jack Jansen wrote:
> On 28-mei-04, at 8:32, brad.allen at omsdal.com wrote:
>>
>> I tried platform.mac_ver(), but this seems to be broken. Google turns  
>> up various bug reports on this function.
>
> I don't fully remember whether something was changed for Python 2.3,  
> but mac_ver() works nicely for me (MacPython 2.3, MacOSX 10.3). What  
> exactly is the problem you're having?

Using Apple's Python 2.3 on 10.3.4, mac_ver() fails for me:

 >>> import platform
 >>> print platform.mac_ver()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/platform.py", line 563, in mac_ver
     sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa'))
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/platform.py", line 532, in _mac_ver_lookup
     append(gestalt(selector))
MacOS.Error: (-5551, 'undefined selector was passed to Gestalt')

My machine doesn't like to do gestalt.gestalt('sysu') (and raises the  
wrong exception for platform.py's  _mac_ver_lookup()?).


-- 
Jim Tittsler             http://www.OnJapan.net/      GPG: 0x01159DB6
Python Starship          http://Starship.Python.net/
Ringo MUG Tokyo          http://www.ringo.net/rss.html




More information about the Pythonmac-SIG mailing list