diff --git a/script/test/test_abort.py b/script/test/test_abort.py index 89de928..0de03c7 100644 --- a/script/test/test_abort.py +++ b/script/test/test_abort.py @@ -20,14 +20,15 @@ import signal -#def on_abort(parent_thread): -# print ("abort") -# ctype_async_raise(parent_thread, KeyboardInterrupt) -# #signal.raise_signal(signal.SIGIOT) +def on_abort(parent_thread): + print ("on_abort") + tid=parent_thread.ident + exception = KeyboardInterrupt + ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exception)) def on_close(parent_thread): - log ("in on_close") + print ("on_close") on_abort(parent_thread) #def handler(signum, frame): @@ -39,7 +40,12 @@ def on_close(parent_thread): time.sleep(2.0) +print (1) time.sleep(2.0) +print (2) time.sleep(2.0) +print (3) time.sleep(2.0) -time.sleep(2.0) \ No newline at end of file +print (4) +time.sleep(2.0) +print (5) \ No newline at end of file