Fix OS X version detection on Mavericks

OS X: Fix system tray notifications causing crashes on some OS X 10.9
(Mavericks) systems (those that had Growl installed at some point).
See #1224491 (Calibre Crashes on Mac OS X Mavericks)
This commit is contained in:
Kovid Goyal 2013-10-24 09:39:27 +05:30
parent 7fc33c08f4
commit 849fd5dbeb

View File

@ -52,7 +52,10 @@ def get_osx_version():
from collections import namedtuple
OSX = namedtuple('OSX', 'major minor tertiary')
try:
_osx_ver = OSX(*(map(int, platform.mac_ver()[0].split('.'))))
ver = platform.mac_ver()[0].split('.')
if len(ver) == 2:
ver.append(0)
_osx_ver = OSX(*(map(int, ver)))
except:
_osx_ver = OSX(0, 0, 0)
return _osx_ver