diff --git a/Lib/random.py b/Lib/random.py index 808175ab4a1..174e755a029 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -105,7 +105,9 @@ def seed(self, a=None, version=2): 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