mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
gh-90623: signal.raise_signal() calls PyErr_CheckSignals() (#91756)
signal.raise_signal() and os.kill() now call PyErr_CheckSignals() to check immediately for pending signals.
This commit is contained in:
parent
c77953b23e
commit
031f1e6040
3 changed files with 19 additions and 1 deletions
|
@ -481,6 +481,13 @@ signal_raise_signal_impl(PyObject *module, int signalnum)
|
|||
if (err) {
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
}
|
||||
|
||||
// If the current thread can handle signals, handle immediately
|
||||
// the raised signal.
|
||||
if (PyErr_CheckSignals()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue