Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

timeout: Correct thread id type passed to PyThreadState_SetAsyncExc.

Anders Kaseorg89e4233b686a
diff --git a/zerver/lib/timeout.py b/zerver/lib/timeout.py
index 3f62b7c2c1a..2514ce41580 100644
--- a/zerver/lib/timeout.py
+++ b/zerver/lib/timeout.py
@@ -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),
)