Script execution
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""
|
||||
|
||||
import ctypes
|
||||
def ctype_async_raise(thread, exception):
|
||||
tid=thread.ident
|
||||
@@ -15,22 +15,22 @@ def ctype_async_raise(thread, exception):
|
||||
ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, NULL)
|
||||
raise SystemError("PyThreadState_SetAsyncExc failed")
|
||||
|
||||
"""
|
||||
import signal
|
||||
|
||||
def on_abort(parent_thread):
|
||||
print ("abort")
|
||||
#ctype_async_raise(parent_thread, KeyboardInterrupt)
|
||||
ctype_async_raise(parent_thread, KeyboardInterrupt)
|
||||
#signal.raise_signal(signal.SIGIOT)
|
||||
|
||||
|
||||
|
||||
|
||||
#def handler(signum, frame):
|
||||
# print('Signal handler called with signal', signum)
|
||||
def handler(signum, frame):
|
||||
print('Signal handler called with signal', signum)
|
||||
# #
|
||||
#
|
||||
# Set the signal handler and a 5-second alarm
|
||||
#signal.signal(signal.SIGINT, handler)
|
||||
signal.signal(signal.SIGINT, handler)
|
||||
|
||||
|
||||
time.sleep(2.0)
|
||||
|
||||
Reference in New Issue
Block a user