diff options
author | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 03:00:20 -0500 |
---|---|---|
committer | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 03:00:20 -0500 |
commit | 623c903ac9a7e0a142babd1ac76da73e4417dab4 (patch) | |
tree | 4a0835afa6ad311d75159487cb3d3c9a052459de /paste/util | |
parent | 3b52451be8e12dabe89e2f7b2b1e638ecd31d1cf (diff) | |
download | paste-623c903ac9a7e0a142babd1ac76da73e4417dab4.tar.gz |
Coerce thread id to a long, might fix problems in Ubuntu: http://trac.pythonpaste.org/pythonpaste/ticket/416
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") |