mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 00:33:58 +02:00
Don't fail catastrophically if appscript does not load
This commit is contained in:
parent
989f07901e
commit
5f8f352e4a
1 changed files with 8 additions and 1 deletions
|
|
@ -22,7 +22,12 @@
|
|||
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 @@ def can_handle(self, device_info, debug=False):
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue