Script execution
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import ctypes
|
||||
def ctype_async_raise(target_tid, exception):
|
||||
ret = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(target_tid), ctypes.py_object(exception))
|
||||
def ctype_async_raise(thread, exception):
|
||||
tid=thread.ident
|
||||
ret = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exception))
|
||||
# ref: http://docs.python.org/c-api/init.html#PyThreadState_SetAsyncExc
|
||||
if ret == 0:
|
||||
raise ValueError("Invalid thread ID")
|
||||
|
||||
Reference in New Issue
Block a user