summaryrefslogtreecommitdiff
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@divmod.com>2010-05-08 20:06:02 +0000
committerJean-Paul Calderone <exarkun@divmod.com>2010-05-08 20:06:02 +0000
commite54ddf1ed2ec9f4166e51a392afeaa857a56d5c3 (patch)
tree1702e4bbab8f31338c919fa32ae24c157569d927 /Modules/signalmodule.c
parent0712b5651a67de5ba3bb9dafa243e6a5b0a80846 (diff)
downloadcpython-git-e54ddf1ed2ec9f4166e51a392afeaa857a56d5c3.tar.gz
Skip signal handler re-installation if it is not necessary. Issue 8354.
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index bb7e4b0dcb..b1ee890bc5 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -198,7 +198,12 @@ signal_handler(int sig_num)
return;
}
#endif
+#ifndef HAVE_SIGACTION
+ /* If the handler was not set up with sigaction, reinstall it. See
+ * Python/pythonrun.c for the implementation of PyOS_setsig which
+ * makes this true. See also issue8354. */
PyOS_setsig(sig_num, signal_handler);
+#endif
}