Add try-catch for USB device set_configuration()

Needs to be added in order to get access denied erro when
sufficient permissions. Affects Linux platform.
This commit is contained in:
Ilkka Pohjalainen 2019-08-02 17:18:19 +03:00
commit 92e97ab880
2 changed files with 5 additions and 1 deletions

View file

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