Kaydet (Commit) cecdd963 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #27776: _PyRandom_Init() doesn't call PyErr_CheckSignals() anymore

Modify py_getrandom() to not call PyErr_CheckSignals() if raise is zero.
_PyRandom_Init() is called very early in the Python initialization, so it's
safer to not call PyErr_CheckSignals().
üst 4bad3b62
......@@ -191,10 +191,13 @@ py_getrandom(void *buffer, Py_ssize_t size, int raise)
}
if (errno == EINTR) {
if (PyErr_CheckSignals()) {
return -1;
if (raise) {
if (PyErr_CheckSignals()) {
return -1;
}
}
/* retry getrandom() */
/* retry getrandom() if it was interrupted by a signal */
continue;
}
......
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