mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error
This commit is contained in:
parent
6974cf2c27
commit
3ee933f1c3
1 changed files with 1 additions and 0 deletions
|
@ -331,6 +331,7 @@ dev_urandom(char *buffer, Py_ssize_t size, int raise)
|
|||
|
||||
if (n <= 0) {
|
||||
/* stop on error or if read(size) returned 0 */
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue