summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-21 06:13:09 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-21 06:13:09 (GMT)
commitfcdd0e40a45d0897ea363e590716cba6fd1834d5 (patch)
tree9a4fd7670580848b7cf96e9fa43b40e85c1a229f
parentad74fa66747020e6ed0c70a5a649cf9cb007179d (diff)
downloadcpython-fcdd0e40a45d0897ea363e590716cba6fd1834d5.zip
cpython-fcdd0e40a45d0897ea363e590716cba6fd1834d5.tar.gz
cpython-fcdd0e40a45d0897ea363e590716cba6fd1834d5.tar.bz2
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.
-rw-r--r--Modules/signalmodule.c4
1 files changed, 3 insertions, 1 deletions
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 @@ 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