summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-03 12:57:12 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-03 12:57:12 (GMT)
commitd0e516db50376ab0fd729c42bafda3e5a6225b94 (patch)
tree125054b4762cd8c0bed63d1a4b82c135f8d5275f /Modules/signalmodule.c
parent2d4a91e0d0065b89cb9820b10e30f74c362cb430 (diff)
downloadcpython-d0e516db50376ab0fd729c42bafda3e5a6225b94.zip
cpython-d0e516db50376ab0fd729c42bafda3e5a6225b94.tar.gz
cpython-d0e516db50376ab0fd729c42bafda3e5a6225b94.tar.bz2
Issue #8407: pthread_sigmask() checks immediatly if signal handlers have been
called. The test checks that SIG_UNBLOCK calls immediatly the signal handler of the pending SIGUSR1. Improve also the tests using an exception (division by zero) instead of a flag (a function attribute).
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 0cb2720..387dc8c 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -573,6 +573,10 @@ signal_pthread_sigmask(PyObject *self, PyObject *args)
return NULL;
}
+ /* if signals was unblocked, signal handlers have been called */
+ if (PyErr_CheckSignals())
+ return NULL;
+
result = PyList_New(0);
if (result == NULL)
return NULL;