[Python-checkins] cpython (merge 3.6 -> default): merge 3.6 (#29085)

benjamin.peterson python-checkins at python.org
Wed Dec 28 23:03:28 EST 2016


https://hg.python.org/cpython/rev/fc3eab44765f
changeset:   105886:fc3eab44765f
parent:      105884:9de7bf6c60d2
parent:      105885:0a55e039d25f
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Dec 28 20:03:23 2016 -0800
summary:
  merge 3.6 (#29085)

files:
  Misc/NEWS               |  3 +++
  Modules/_randommodule.c |  2 +-
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -734,6 +734,9 @@
 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
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -245,7 +245,7 @@
         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:

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list