Kaydet (Commit) acc2f74c authored tarafından Benjamin Peterson's avatar Benjamin Peterson

fix error check, so that Random.seed actually uses OS randomness (closes #29085)

üst 4b1e98b0
......@@ -40,6 +40,9 @@ Core and Builtins
Library
-------
- Issue #29085: Allow random.Random.seed() to use high quality OS randomness
rather than the pid and time.
- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows
- Issue #13051: Fixed recursion errors in large or resized
......
......@@ -245,7 +245,7 @@ random_seed(RandomObject *self, PyObject *args)
return NULL;
if (arg == NULL || arg == Py_None) {
if (random_seed_urandom(self) >= 0) {
if (random_seed_urandom(self) < 0) {
PyErr_Clear();
/* Reading system entropy failed, fall back on the worst entropy:
......
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