churchyard / rpms / python3

Forked from rpms/python3 3 years ago
Clone

Blame 00254-make-Random.seed-actually-use-OS-randomness.patch

79728f7
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
79728f7
index 63759d5..0d3282d 100644
79728f7
--- a/Modules/_randommodule.c
79728f7
+++ b/Modules/_randommodule.c
79728f7
@@ -245,7 +245,7 @@ random_seed(RandomObject *self, PyObject *args)
79728f7
         return NULL;
79728f7
 
79728f7
      if (arg == NULL || arg == Py_None) {
79728f7
-        if (random_seed_urandom(self) >= 0) {
79728f7
+        if (random_seed_urandom(self) < 0) {
79728f7
             PyErr_Clear();
79728f7
 
79728f7
             /* Reading system entropy failed, fall back on the worst entropy: