summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-12-29 04:02:35 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-12-29 04:02:35 (GMT)
commitacc2f74ca991f6579f5b9055dfe885b9a8af4645 (patch)
treee81403eab8acdd2c64d7c5369147fd34e17213bb /Modules
parent4b1e98b0af68ee80a37618ad599ead194f179cf1 (diff)
downloadcpython-acc2f74ca991f6579f5b9055dfe885b9a8af4645.zip
cpython-acc2f74ca991f6579f5b9055dfe885b9a8af4645.tar.gz
cpython-acc2f74ca991f6579f5b9055dfe885b9a8af4645.tar.bz2
fix error check, so that Random.seed actually uses OS randomness (closes #29085)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_randommodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 63759d5..0d3282d 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: