summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/multiprocessing/spawn.py
diff options
context:
space:
mode:
authorshadchin <[email protected]>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/multiprocessing/spawn.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/multiprocessing/spawn.py')
-rw-r--r--contrib/tools/python3/src/Lib/multiprocessing/spawn.py34
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 f7f8deb2463..2ac0b653b64 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():