Merge pull request #1 from Elktro/master
Add try-catch for USB device set_configuration()
This commit is contained in:
commit
f343d16767
2 changed files with 5 additions and 1 deletions
|
|
@ -403,7 +403,11 @@ else:
|
|||
return self._connected
|
||||
|
||||
# Copy the default configuration.
|
||||
usb_device.set_configuration()
|
||||
try:
|
||||
usb_device.set_configuration()
|
||||
except core.USBError as e:
|
||||
log.warning('Error connecting: %s', e)
|
||||
self._error()
|
||||
config = usb_device.get_active_configuration()
|
||||
interface = config[(0, 0)]
|
||||
|
||||
|
|
|
|||
0
setup.py
Normal file → Executable file
0
setup.py
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue