Skip to content

Commit 6044f2c

Browse files
committed
simplify was_attached attribute
1 parent 5f4288f commit 6044f2c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

adafruit_usb_host_mouse/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def find_and_init_boot_mouse(cursor_image=DEFAULT_CURSOR): # noqa: PLR0912
9696
if mouse_device is not None:
9797
# detach the kernel driver if needed
9898
if mouse_device.is_kernel_driver_active(mouse_interface_index):
99-
mouse_was_attached = [[mouse_interface_index]]
99+
mouse_was_attached = [mouse_interface_index]
100100
mouse_device.detach_kernel_driver(mouse_interface_index)
101101

102102
# set configuration on the mouse so we can use it
@@ -186,7 +186,7 @@ def find_and_init_report_mouse(cursor_image=DEFAULT_CURSOR): # noqa: PLR0912
186186
mouse_device.detach_kernel_driver(intf)
187187

188188
if len(_attach_list) > 0:
189-
mouse_was_attached = [_attach_list]
189+
mouse_was_attached = _attach_list
190190

191191
# set configuration on the mouse so we can use it
192192
mouse_device.set_configuration()
@@ -304,7 +304,7 @@ def release(self):
304304
# was_attached is an empty list if no interfaces were detached from the kernel
305305
if self.was_attached:
306306
# the first element of the was_attached list is a list of detached interfaces
307-
for intf in self.was_attached[0]:
307+
for intf in self.was_attached:
308308
if not self.device.is_kernel_driver_active(intf):
309309
self.device.attach_kernel_driver(intf)
310310

0 commit comments

Comments
 (0)