diff options
Diffstat (limited to 'paste/util')
-rw-r--r-- | paste/util/killthread.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/paste/util/killthread.py b/paste/util/killthread.py index 5b3406c..f1fc93f 100644 --- a/paste/util/killthread.py +++ b/paste/util/killthread.py @@ -20,11 +20,11 @@ def async_raise(tid, exctype): raise TypeError("Only types can be raised (not instances)") if not isinstance(tid, int): raise TypeError("tid must be an integer") - res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exctype)) if res == 0: raise ValueError("invalid thread id") elif res != 1: - # """if it returns a number greater than one, you're in trouble, + # """if it returns a number greater than one, you're in trouble, # and you should call it again with exc=NULL to revert the effect""" - ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0) + ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), 0) raise SystemError("PyThreadState_SetAsyncExc failed") |