diff -r f477ce0d2345 Lib/random.py --- a/Lib/random.py Tue Jun 07 11:25:43 2016 +0200 +++ b/Lib/random.py Tue Jun 07 14:19:08 2016 -0400 @@ -65,6 +65,12 @@ import _random + +def _time_seed(): + import time + return int(time.time() * 256) # use fractional seconds + + class Random(_random.Random): """Random number generator base class used by bound module functions. @@ -109,8 +115,7 @@ # 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 + a = _time_seed() if version == 2: if isinstance(a, (str, bytes, bytearray)): @@ -715,7 +720,7 @@ # for most programs and is easier for the casual user than making them # instantiate their own Random() instance. -_inst = Random() +_inst = Random(_time_seed()) seed = _inst.seed random = _inst.random uniform = _inst.uniform