diff options
author | Davin Potts <python@discontinuity.net> | 2016-09-09 23:03:10 (GMT) |
---|---|---|
committer | Davin Potts <python@discontinuity.net> | 2016-09-09 23:03:10 (GMT) |
commit | 5458647bb867770fc3d830a618cef6994fdfac4b (patch) | |
tree | f16fef69f4ddf36872152328fe302d22e2258763 /Lib/multiprocessing/spawn.py | |
parent | f1024f74250d534d16a9970e5093b3b4e693b398 (diff) | |
download | cpython-5458647bb867770fc3d830a618cef6994fdfac4b.zip cpython-5458647bb867770fc3d830a618cef6994fdfac4b.tar.gz cpython-5458647bb867770fc3d830a618cef6994fdfac4b.tar.bz2 |
Issue #28053: Applying refactorings, docs and other cleanup to follow.
Diffstat (limited to 'Lib/multiprocessing/spawn.py')
-rw-r--r-- | Lib/multiprocessing/spawn.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py index 4d76951..dfb9f65 100644 --- a/Lib/multiprocessing/spawn.py +++ b/Lib/multiprocessing/spawn.py @@ -9,13 +9,13 @@ # import os -import pickle import sys import runpy import types from . import get_start_method, set_start_method from . import process +from .context import reduction from . import util __all__ = ['_main', 'freeze_support', 'set_executable', 'get_executable', @@ -96,8 +96,7 @@ def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None): assert is_forking(sys.argv) if sys.platform == 'win32': import msvcrt - from .reduction import steal_handle - new_handle = steal_handle(parent_pid, pipe_handle) + new_handle = reduction.steal_handle(parent_pid, pipe_handle) fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY) else: from . import semaphore_tracker @@ -111,9 +110,9 @@ def _main(fd): with os.fdopen(fd, 'rb', closefd=True) as from_parent: process.current_process()._inheriting = True try: - preparation_data = pickle.load(from_parent) + preparation_data = reduction.pickle.load(from_parent) prepare(preparation_data) - self = pickle.load(from_parent) + self = reduction.pickle.load(from_parent) finally: del process.current_process()._inheriting return self._bootstrap() |