Unverified Kaydet (Commit) 0aab8660 authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-33929: Fix regression in spawn_main() (#7962)

OpenProcess() creates a new handle that must be closed later.
üst 2cc9d21f
...@@ -103,8 +103,12 @@ def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None): ...@@ -103,8 +103,12 @@ def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None):
_winapi.PROCESS_DUP_HANDLE, False, parent_pid) _winapi.PROCESS_DUP_HANDLE, False, parent_pid)
else: else:
source_process = None source_process = None
new_handle = reduction.duplicate(pipe_handle, try:
source_process=source_process) new_handle = reduction.duplicate(pipe_handle,
source_process=source_process)
finally:
if source_process is not None:
_winapi.CloseHandle(source_process)
fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY) fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY)
else: else:
from . import semaphore_tracker from . import semaphore_tracker
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment