Fix problem with dev.is_kernel_driver_active(0)

This commit is contained in:
Philipp Klaus
2016-09-20 09:40:23 +02:00
parent 2a0bc50113
commit 4eb4a3657d

View File

@@ -86,10 +86,11 @@ class BrotherQLBackendPyUSB(BrotherQLBackendGeneric):
# Now we are sure to have self.dev around, start using it:
if self.dev.is_kernel_driver_active(0):
try:
assert self.dev.is_kernel_driver_active(0)
self.dev.detach_kernel_driver(0)
self.was_kernel_driver_active = True
else:
except (NotImplementedError, AssertionError):
self.was_kernel_driver_active = False
# set the active configuration. With no arguments, the first configuration will be the active one