From c01b8454f59e3d9016952540616cfb5789a1739f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Aug 2009 11:50:09 -0600 Subject: [PATCH] IGN:PRS500 driver: Fix card function to not raise an exception when no card is present --- src/calibre/devices/prs500/driver.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/prs500/driver.py b/src/calibre/devices/prs500/driver.py index 73dd5b543d..4273101273 100644 --- a/src/calibre/devices/prs500/driver.py +++ b/src/calibre/devices/prs500/driver.py @@ -794,10 +794,16 @@ class PRS500(DeviceConfig, DevicePlugin): def card(self, end_session=True): """ Return path prefix to installed card or None """ card = None - if self._exists("a:/")[0]: - card = "a:" - if self._exists("b:/")[0]: - card = "b:" + try: + if self._exists("a:/")[0]: + card = "a:" + except: + pass + try: + if self._exists("b:/")[0]: + card = "b:" + except: + pass return card @safe