From fcdd0e40a45d0897ea363e590716cba6fd1834d5 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 21 Jan 1997 06:13:09 +0000 Subject: [PATCH] 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. --- Modules/signalmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index f15c62a3c0c..e6d3f19fda6 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -115,6 +115,7 @@ signal_handler(sig_num) #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 @@ PyErr_CheckSignals() Py_DECREF(arglist); } if (!result) - return 1; + return -1; Py_DECREF(result); } @@ -541,6 +542,7 @@ PyErr_SetInterrupt() { is_tripped++; Handlers[SIGINT].tripped = 1; + Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL); } void