IGN:PRS500 driver: Fix card function to not raise an exception when no card is present

This commit is contained in:
Kovid Goyal 2009-08-12 11:50:09 -06:00
parent c30fb96ebf
commit c01b8454f5

View File

@ -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