timeout: Correct thread id type passed to PyThreadState_SetAsyncExc.

This type changed in Python 3.7:
https://github.com/python/cpython/pull/781

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 89e4233b68)
This commit is contained in:
Anders Kaseorg
2022-10-19 15:58:33 -04:00
committed by Tim Abbott
parent f14dde1a64
commit 7f6bd415f0

View File

@@ -60,7 +60,7 @@ def timeout(timeout: float, func: Callable[[], ResultT]) -> ResultT:
# to raise a TimeoutExpired in _this_ thread.
assert self.ident is not None
ctypes.pythonapi.PyThreadState_SetAsyncExc(
ctypes.c_long(self.ident),
ctypes.c_ulong(self.ident),
ctypes.py_object(TimeoutExpired),
)