Skip to content

Commit c9ce92b

Browse files
committed
usb1: Fix context pointer comparison in hotplugRegisterCallback
This was likely broken by the pointer type change in usb1: Enforce object finalization order. as void and non-void pointers do not have the same attributes in ctypes.
1 parent 4e7b694 commit c9ce92b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

usb1/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,8 +2608,9 @@ def hotplugRegisterCallback(
26082608
it cannot call any synchronous libusb function.
26092609
"""
26102610
def wrapped_callback(context_p, device_p, event, _):
2611-
assert addressof(context_p.contents) == addressof(
2612-
self.__context_p.contents), (context_p, self.__context_p)
2611+
assert context_p == self.__context_p.value, (
2612+
context_p, self.__context_p,
2613+
)
26132614
device = USBDevice(
26142615
context=self,
26152616
device_p=device_p,

0 commit comments

Comments
 (0)