From 5f8f352e4a4b011fee91c40e5d7d6e38e4cf257c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Jun 2010 01:30:12 -0600 Subject: [PATCH] Don't fail catastrophically if appscript does not load --- src/calibre/devices/apple/driver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index dddd60cadf..e17d8e980c 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -22,7 +22,12 @@ from calibre.devices.errors import UserFeedback from PIL import Image as PILImage if isosx: - import appscript + try: + import appscript + appscript + except: + # appscript fails to load on 10.4 + appscript = None if iswindows: import pythoncom, win32com.client @@ -268,6 +273,8 @@ class ITUNES(DevicePlugin): instantiate iTunes if necessary This gets called ~1x/second while device fingerprint is sensed ''' + if appscript is None: + return False if self.iTunes: # Check for connected book-capable device