Find devices should return an empty list when libusb is not available.

This commit is contained in:
Kovid Goyal 2007-11-06 18:41:54 +00:00
parent 5ad276ba7f
commit 5a318e112f

View File

@ -145,6 +145,8 @@ class Bus(Structure):
TODO: Check if exploring children is neccessary (e.g. with an external hub) TODO: Check if exploring children is neccessary (e.g. with an external hub)
""" """
def fget(self): def fget(self):
if _libusb is None:
return []
if _libusb.usb_find_devices() < 0: if _libusb.usb_find_devices() < 0:
raise Error('Unable to search for USB devices') raise Error('Unable to search for USB devices')
ndev = self.devices ndev = self.devices