Arrange for PyErr_CheckSignals() to be called via Py_AddPendingCall().
This avoids having to call sigcheck() (the same routine by its old
name :-) in the ticker code in ceval.c's main interpreter loop.
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index f15c62a..e6d3f19 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -115,6 +115,7 @@
#endif
is_tripped++;
Handlers[sig_num].tripped = 1;
+ Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
#ifdef WITH_THREAD
}
#endif
@@ -523,7 +524,7 @@
Py_DECREF(arglist);
}
if (!result)
- return 1;
+ return -1;
Py_DECREF(result);
}
@@ -541,6 +542,7 @@
{
is_tripped++;
Handlers[SIGINT].tripped = 1;
+ Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
}
void