Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5f87b9

Browse files
author
Stefan Krah
authored
Call randseed() before other imports in deccheck.py (GH-21834)
1 parent 76643c1 commit b5f87b9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Modules/_decimal/tests/deccheck.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@
3030
#
3131

3232

33+
import random
34+
import time
35+
36+
RANDSEED = int(time.time())
37+
random.seed(RANDSEED)
38+
3339
import sys
3440
import os
35-
import time
36-
import random
3741
from copy import copy
3842
from collections import defaultdict
3943

@@ -1235,10 +1239,6 @@ def check_untested(funcdict, c_cls, p_cls):
12351239
args.single = args.single[0]
12361240

12371241

1238-
randseed = int(time.time())
1239-
random.seed(randseed)
1240-
1241-
12421242
# Set up the testspecs list. A testspec is simply a dictionary
12431243
# that determines the amount of different contexts that 'test_method'
12441244
# will generate.
@@ -1306,9 +1306,9 @@ def check_untested(funcdict, c_cls, p_cls):
13061306
if args.multicore:
13071307
q = Queue()
13081308
elif args.single:
1309-
log("Random seed: %d", randseed)
1309+
log("Random seed: %d", RANDSEED)
13101310
else:
1311-
log("\n\nRandom seed: %d\n\n", randseed)
1311+
log("\n\nRandom seed: %d\n\n", RANDSEED)
13121312

13131313

13141314
FOUND_METHOD = False

0 commit comments

Comments
 (0)