summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-11-03 21:53:55 (GMT)
committerGuido van Rossum <guido@python.org>1997-11-03 21:53:55 (GMT)
commit7ff20ac9c7519f3ecef33331f6222304fe1772f1 (patch)
tree442c3d944461f35e7b92380269752f17e81f853d /Modules
parent615022fbf844ba5bbab1482b2e36e0ab8f452869 (diff)
downloadcpython-7ff20ac9c7519f3ecef33331f6222304fe1772f1.zip
cpython-7ff20ac9c7519f3ecef33331f6222304fe1772f1.tar.gz
cpython-7ff20ac9c7519f3ecef33331f6222304fe1772f1.tar.bz2
Change the signal finialization so that it also resets the signal
handlers. After this has been called, our signal handlers are no longer active!
Diffstat (limited to 'Modules')
-rw-r--r--Modules/signalmodule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 2b4e5c3..e815492 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -513,13 +513,19 @@ static void
finisignal()
{
int i;
+ PyObject *func;
signal(SIGINT, old_siginthandler);
+ old_siginthandler = SIG_DFL;
for (i = 1; i < NSIG; i++) {
+ func = Handlers[i].func;
Handlers[i].tripped = 0;
- Py_XDECREF(Handlers[i].func);
Handlers[i].func = NULL;
+ if (i != SIGINT && func != NULL && func != Py_None &&
+ func != DefaultHandler && func != IgnoreHandler)
+ signal(i, SIG_DFL);
+ Py_XDECREF(func);
}
Py_XDECREF(IntHandler);