Handle USBError to prevent 'Resource Busy' error
This commit is contained in:
parent
4cefd2a594
commit
5fc68092d8
|
@ -84,7 +84,12 @@ class Luxafor:
|
|||
if device is None:
|
||||
raise Exception('Device was not found.')
|
||||
|
||||
device.set_configuration()
|
||||
try:
|
||||
device.set_configuration()
|
||||
except usb.core.USBError:
|
||||
# Prevent Resource busy errors
|
||||
device.detach_kernel_driver(0)
|
||||
device.set_configuration()
|
||||
|
||||
self.device = device
|
||||
|
||||
|
|
Loading…
Reference in New Issue