diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Lib/multiprocessing/spawn.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/multiprocessing/spawn.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/multiprocessing/spawn.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/spawn.py b/contrib/tools/python3/src/Lib/multiprocessing/spawn.py index 2ac0b653b6..f7f8deb246 100644 --- a/contrib/tools/python3/src/Lib/multiprocessing/spawn.py +++ b/contrib/tools/python3/src/Lib/multiprocessing/spawn.py @@ -96,28 +96,28 @@ def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None): assert is_forking(sys.argv), "Not forking" if sys.platform == 'win32': import msvcrt - import _winapi - - if parent_pid is not None: - source_process = _winapi.OpenProcess( - _winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, - False, parent_pid) - else: - source_process = None - new_handle = reduction.duplicate(pipe_handle, - source_process=source_process) + import _winapi + + if parent_pid is not None: + source_process = _winapi.OpenProcess( + _winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, + False, parent_pid) + else: + source_process = None + new_handle = reduction.duplicate(pipe_handle, + source_process=source_process) fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY) - parent_sentinel = source_process + parent_sentinel = source_process else: - from . import resource_tracker - resource_tracker._resource_tracker._fd = tracker_fd + from . import resource_tracker + resource_tracker._resource_tracker._fd = tracker_fd fd = pipe_handle - parent_sentinel = os.dup(pipe_handle) - exitcode = _main(fd, parent_sentinel) + parent_sentinel = os.dup(pipe_handle) + exitcode = _main(fd, parent_sentinel) sys.exit(exitcode) -def _main(fd, parent_sentinel): +def _main(fd, parent_sentinel): with os.fdopen(fd, 'rb', closefd=True) as from_parent: process.current_process()._inheriting = True try: @@ -126,7 +126,7 @@ def _main(fd, parent_sentinel): self = reduction.pickle.load(from_parent) finally: del process.current_process()._inheriting - return self._bootstrap(parent_sentinel) + return self._bootstrap(parent_sentinel) def _check_not_importing_main(): |