summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-05-18 04:05:10 (GMT)
committerLarry Hastings <larry@hastings.org>2014-05-18 04:05:10 (GMT)
commit3a260d228b32b04a88d947b887bf81759e8e5f10 (patch)
treee4a34e9cbbf877cf021ffba743ddbf54e17526b7 /Lib/random.py
parent2110603344316d927e6d639275c12f5da78601d5 (diff)
parentb1a1ec3151155a1ae65831793b4a5b7a87d9d09f (diff)
downloadcpython-3a260d228b32b04a88d947b887bf81759e8e5f10.zip
cpython-3a260d228b32b04a88d947b887bf81759e8e5f10.tar.gz
cpython-3a260d228b32b04a88d947b887bf81759e8e5f10.tar.bz2
Merge.
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 808175a..174e755a 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -105,7 +105,9 @@ class Random(_random.Random):
if a is None:
try:
- a = int.from_bytes(_urandom(32), 'big')
+ # Seed with enough bytes to span the 19937 bit
+ # state space for the Mersenne Twister
+ a = int.from_bytes(_urandom(2500), 'big')
except NotImplementedError:
import time
a = int(time.time() * 256) # use fractional seconds