diff options
author | Larry Hastings <larry@hastings.org> | 2015-03-30 01:50:00 -0700 |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2015-03-30 01:50:00 -0700 |
commit | 09dab7a87eaa7115eeaf73016d65f2f835e25986 (patch) | |
tree | 04a83c1cfce64d3418a245feae7fee445e510949 /Python/random.c | |
parent | 736240399e469a4134dac32a340feca5395baa28 (diff) | |
parent | 45cff0c0e6c4a31ed3b5b88ee803320862fbd43a (diff) | |
download | cpython-git-09dab7a87eaa7115eeaf73016d65f2f835e25986.tar.gz |
Merge 3.5.0a3 release engineering changes back into trunk.
Diffstat (limited to 'Python/random.c')
-rw-r--r-- | Python/random.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/random.c b/Python/random.c index a281829f97..a4eba3ccd9 100644 --- a/Python/random.c +++ b/Python/random.c @@ -221,7 +221,7 @@ dev_urandom_python(char *buffer, Py_ssize_t size) if (urandom_cache.fd >= 0) { /* Does the fd point to the same thing as before? (issue #21207) */ - if (_Py_fstat(urandom_cache.fd, &st) + if (_Py_fstat_noraise(urandom_cache.fd, &st) || st.st_dev != urandom_cache.st_dev || st.st_ino != urandom_cache.st_ino) { /* Something changed: forget the cached fd (but don't close it, @@ -250,7 +250,6 @@ dev_urandom_python(char *buffer, Py_ssize_t size) } else { if (_Py_fstat(fd, &st)) { - PyErr_SetFromErrno(PyExc_OSError); close(fd); return -1; } |