diff --git a/Misc/NEWS b/Misc/NEWS index 1987e75c0ee..31fdde1d04f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -734,6 +734,9 @@ Core and Builtins Library ------- +- Issue #29085: Allow random.Random.seed() to use high quality OS randomness + rather than the pid and time. + - Issue 28923: Remove editor artifacts from Tix.py. - Issue #29055: Neaten-up empty population error on random.choice() diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 63759d55624..0d3282db8f2 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -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: