diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-06-13 22:03:43 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-06-13 22:03:43 (GMT) |
commit | 93e8e5492402d55e0c0c4b08ff213783f5891561 (patch) | |
tree | 9ddc2d28359821d777e311d62835180cf84a4e3e /Lib/idlelib | |
parent | a11e84613579e2487bcb3967d3a2edbd0665343a (diff) | |
download | cpython-93e8e5492402d55e0c0c4b08ff213783f5891561.zip cpython-93e8e5492402d55e0c0c4b08ff213783f5891561.tar.gz cpython-93e8e5492402d55e0c0c4b08ff213783f5891561.tar.bz2 |
Interrupt module has been folded into the thread module
Modified Files:
run.py
Removed Files:
interruptmodule.c
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/interruptmodule.c | 49 | ||||
-rw-r--r-- | Lib/idlelib/run.py | 10 |
2 files changed, 5 insertions, 54 deletions
diff --git a/Lib/idlelib/interruptmodule.c b/Lib/idlelib/interruptmodule.c deleted file mode 100644 index 8e18d5a..0000000 --- a/Lib/idlelib/interruptmodule.c +++ /dev/null @@ -1,49 +0,0 @@ -/*********************************************************************** - * interruptmodule.c - * - * Python extension implementing the interrupt module. - * - **********************************************************************/ - -#include "Python.h" - -#ifndef PyDoc_STR -#define PyDoc_VAR(name) static char name[] -#define PyDoc_STR(str) str -#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) -#endif - -/* module documentation */ - -PyDoc_STRVAR(module_doc, -"Provide a way to interrupt the main thread from a subthread.\n\n\ -In threaded Python code the KeyboardInterrupt is always directed to\n\ -the thread which raised it. This extension provides a method,\n\ -interrupt_main, which a subthread can use to raise a KeyboardInterrupt\n\ -in the main thread."); - -/* module functions */ - -static PyObject * -setinterrupt(PyObject * self, PyObject * args) -{ - PyErr_SetInterrupt(); - Py_INCREF(Py_None); - return Py_None; -} - -/* registration table */ - -static struct PyMethodDef methods[] = { - {"interrupt_main", setinterrupt, METH_VARARGS, - PyDoc_STR("Interrupt the main thread")}, - {NULL, NULL} -}; - -/* module initialization */ - -void -initinterrupt(void) -{ - (void) Py_InitModule3("interrupt", methods, module_doc); -} diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 5e86e47..7ff8b55 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -3,6 +3,7 @@ import os import time import socket import traceback +import thread import threading import Queue @@ -13,7 +14,6 @@ import RemoteDebugger import RemoteObjectBrowser import StackViewer import rpc -import interrupt import __main__ @@ -189,7 +189,7 @@ class MyRPCServer(rpc.RPCServer): except EOFError: global exit_now exit_now = True - interrupt.interrupt_main() + thread.interrupt_main() except: erf = sys.__stderr__ print>>erf, '\n' + '-'*40 @@ -223,13 +223,13 @@ class MyHandler(rpc.RPCHandler): "Override SocketIO method - terminate wait on callback and exit thread" global quitting quitting = True - interrupt.interrupt_main() + thread.interrupt_main() def decode_interrupthook(self): "interrupt awakened thread" global quitting quitting = True - interrupt.interrupt_main() + thread.interrupt_main() class Executive: @@ -256,7 +256,7 @@ class Executive: flush_stdout() def interrupt_the_server(self): - interrupt.interrupt_main() + thread.interrupt_main() def start_the_debugger(self, gui_adap_oid): return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) |