cpython: 28b465d8c519 (original) (raw)

Mercurial > cpython

changeset 95292:28b465d8c519

Issue #22181: os.urandom() now releases the GIL when the getrandom() implementation is used. [#22181]

Victor Stinner victor.stinner@gmail.com
date Mon, 30 Mar 2015 11:16:40 +0200
parents e46c3138b5b3
children 7f1015e4277a
files Python/random.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-)[+] [-] Python/random.c 13

line wrap: on

line diff

--- a/Python/random.c +++ b/Python/random.c @@ -115,9 +115,18 @@ py_getrandom(void *buffer, Py_ssize_t si while (0 < size) { errno = 0;

+

+ if (n < 0) { if (errno == ENOSYS) { getrandom_works = 0;