summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-05-27 15:50:54 (GMT)
committerGitHub <noreply@github.com>2017-05-27 15:50:54 (GMT)
commit346cbd351ee0dd3ab9cb9f0e4cb625556707877e (patch)
tree8590c5fc85acf57750ecb8d07a407a3dbe233f85 /Lib/multiprocessing
parentf931fd1c2ad969db72460d3ab41e3d1a4a62c371 (diff)
downloadcpython-346cbd351ee0dd3ab9cb9f0e4cb625556707877e.zip
cpython-346cbd351ee0dd3ab9cb9f0e4cb625556707877e.tar.gz
cpython-346cbd351ee0dd3ab9cb9f0e4cb625556707877e.tar.bz2
bpo-16500: Allow registering at-fork handlers (#1715)
* bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/forkserver.py5
-rw-r--r--Lib/multiprocessing/popen_fork.py3
2 files changed, 0 insertions, 8 deletions
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py
index 6e09539..8156dae 100644
--- a/Lib/multiprocessing/forkserver.py
+++ b/Lib/multiprocessing/forkserver.py
@@ -210,11 +210,6 @@ def _serve_one(s, listener, alive_r, handlers):
# send pid to client processes
write_unsigned(child_w, os.getpid())
- # reseed random number generator
- if 'random' in sys.modules:
- import random
- random.seed()
-
# run process object received over pipe
code = spawn._main(child_r)
diff --git a/Lib/multiprocessing/popen_fork.py b/Lib/multiprocessing/popen_fork.py
index d2ebd7c..683b52d 100644
--- a/Lib/multiprocessing/popen_fork.py
+++ b/Lib/multiprocessing/popen_fork.py
@@ -68,9 +68,6 @@ class Popen(object):
if self.pid == 0:
try:
os.close(parent_r)
- if 'random' in sys.modules:
- import random
- random.seed()
code = process_obj._bootstrap()
finally:
os._exit(code)