summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal/tests
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2020-08-11 19:14:51 (GMT)
committerGitHub <noreply@github.com>2020-08-11 19:14:51 (GMT)
commitb5f87b93a542082551c67538523d318f0d46e16e (patch)
treeab4127f23ec804a5867f1479d6e5c8223c9caa54 /Modules/_decimal/tests
parent76643c10ede2813ca921464fe839e81caee21a84 (diff)
downloadcpython-b5f87b93a542082551c67538523d318f0d46e16e.zip
cpython-b5f87b93a542082551c67538523d318f0d46e16e.tar.gz
cpython-b5f87b93a542082551c67538523d318f0d46e16e.tar.bz2
Call randseed() before other imports in deccheck.py (GH-21834)
Diffstat (limited to 'Modules/_decimal/tests')
-rw-r--r--Modules/_decimal/tests/deccheck.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py
index 0b2a1c4..ca869f4 100644
--- a/Modules/_decimal/tests/deccheck.py
+++ b/Modules/_decimal/tests/deccheck.py
@@ -30,10 +30,14 @@
#
+import random
+import time
+
+RANDSEED = int(time.time())
+random.seed(RANDSEED)
+
import sys
import os
-import time
-import random
from copy import copy
from collections import defaultdict
@@ -1235,10 +1239,6 @@ if __name__ == '__main__':
args.single = args.single[0]
- randseed = int(time.time())
- random.seed(randseed)
-
-
# Set up the testspecs list. A testspec is simply a dictionary
# that determines the amount of different contexts that 'test_method'
# will generate.
@@ -1306,9 +1306,9 @@ if __name__ == '__main__':
if args.multicore:
q = Queue()
elif args.single:
- log("Random seed: %d", randseed)
+ log("Random seed: %d", RANDSEED)
else:
- log("\n\nRandom seed: %d\n\n", randseed)
+ log("\n\nRandom seed: %d\n\n", RANDSEED)
FOUND_METHOD = False