8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdd38cb commit 3438104Copy full SHA for 3438104
Modules/signalmodule.c
@@ -1911,7 +1911,15 @@ PyErr_SetInterruptEx(int signum)
1911
1912
signal_state_t *state = &signal_global_state;
1913
PyObject *func = get_handler(signum);
1914
- if (func != state->ignore_handler && func != state->default_handler) {
+ int is_ign = PyObject_RichCompareBool(func, state->ignore_handler, Py_EQ);
1915
+ if (is_ign == -1) {
1916
+ return -1;
1917
+ }
1918
+ int is_dfl = PyObject_RichCompareBool(func, state->default_handler, Py_EQ);
1919
+ if (is_dfl == -1) {
1920
1921
1922
+ if ((is_ign == 0) && (is_dfl == 0)) {
1923
trip_signal(signum);
1924
}
1925
return 0;
0 commit comments