MCPcopy Create free account
hub / github.com/EasyIME/PIME / _reseed_random

Function _reseed_random

python/python3/tornado/process.py:64–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63
64def _reseed_random() -> None:
65 if "random" not in sys.modules:
66 return
67 import random
68
69 # If os.urandom is available, this method does the same thing as
70 # random.seed (at least as of python 2.6). If os.urandom is not
71 # available, we mix in the pid in addition to a timestamp.
72 try:
73 seed = int(hexlify(os.urandom(16)), 16)
74 except NotImplementedError:
75 seed = int(time.time() * 1000) ^ os.getpid()
76 random.seed(seed)
77
78
79_task_id = None

Callers 1

start_childFunction · 0.85

Calls 1

timeMethod · 0.80

Tested by

no test coverage detected