diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2018-06-27 12:45:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 12:45:01 -0400 |
commit | f331080ecb52ca9ce522c41622afd057ced567b3 (patch) | |
tree | 15069d49d7c5be1e52ec37a2afea91764efafc51 /Lib/multiprocessing/reduction.py | |
parent | 28bd988bd7ffcee2204f0fcbfdb42f90734f8431 (diff) | |
download | cpython-git-revert-7960-backport-2cc9d21-3.7.tar.gz |
Revert "bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)"revert-7960-backport-2cc9d21-3.7
This reverts commit 8b1ebcd7cb3319273ea635df78ebf9ad40171514.
Diffstat (limited to 'Lib/multiprocessing/reduction.py')
-rw-r--r-- | Lib/multiprocessing/reduction.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/multiprocessing/reduction.py b/Lib/multiprocessing/reduction.py index 473fd59df6..deca19ccad 100644 --- a/Lib/multiprocessing/reduction.py +++ b/Lib/multiprocessing/reduction.py @@ -68,16 +68,12 @@ if sys.platform == 'win32': __all__ += ['DupHandle', 'duplicate', 'steal_handle'] import _winapi - def duplicate(handle, target_process=None, inheritable=False, - *, source_process=None): + def duplicate(handle, target_process=None, inheritable=False): '''Duplicate a handle. (target_process is a handle not a pid!)''' - current_process = _winapi.GetCurrentProcess() - if source_process is None: - source_process = current_process if target_process is None: - target_process = current_process + target_process = _winapi.GetCurrentProcess() return _winapi.DuplicateHandle( - source_process, handle, target_process, + _winapi.GetCurrentProcess(), handle, target_process, 0, inheritable, _winapi.DUPLICATE_SAME_ACCESS) def steal_handle(source_pid, handle): |