Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcdd0e4

Browse files
committed
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.
1 parent ad74fa6 commit fcdd0e4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/signalmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ signal_handler(sig_num)
115115
#endif
116116
is_tripped++;
117117
Handlers[sig_num].tripped = 1;
118+
Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
118119
#ifdef WITH_THREAD
119120
}
120121
#endif
@@ -523,7 +524,7 @@ PyErr_CheckSignals()
523524
Py_DECREF(arglist);
524525
}
525526
if (!result)
526-
return 1;
527+
return -1;
527528

528529
Py_DECREF(result);
529530
}
@@ -541,6 +542,7 @@ PyErr_SetInterrupt()
541542
{
542543
is_tripped++;
543544
Handlers[SIGINT].tripped = 1;
545+
Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
544546
}
545547

546548
void

0 commit comments

Comments
 (0)