Commit 7a8aa9c8 authored by Guido van Rossum's avatar Guido van Rossum

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.
parent eeae0501
...@@ -115,6 +115,7 @@ signal_handler(sig_num) ...@@ -115,6 +115,7 @@ signal_handler(sig_num)
#endif #endif
is_tripped++; is_tripped++;
Handlers[sig_num].tripped = 1; Handlers[sig_num].tripped = 1;
Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
#ifdef WITH_THREAD #ifdef WITH_THREAD
} }
#endif #endif
...@@ -523,7 +524,7 @@ PyErr_CheckSignals() ...@@ -523,7 +524,7 @@ PyErr_CheckSignals()
Py_DECREF(arglist); Py_DECREF(arglist);
} }
if (!result) if (!result)
return 1; return -1;
Py_DECREF(result); Py_DECREF(result);
} }
...@@ -541,6 +542,7 @@ PyErr_SetInterrupt() ...@@ -541,6 +542,7 @@ PyErr_SetInterrupt()
{ {
is_tripped++; is_tripped++;
Handlers[SIGINT].tripped = 1; Handlers[SIGINT].tripped = 1;
Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment