From 849fd5dbebcb007ffb6cdf5e9ea7290bfdd13531 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Oct 2013 09:39:27 +0530 Subject: [PATCH] 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) --- src/calibre/constants.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 807bf5d74c..ad728b7712 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -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