mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-33929: Fix regression in spawn_main() (#7962)
OpenProcess() creates a new handle that must be closed later.
This commit is contained in:
parent
2cc9d21fff
commit
0aab8660cd
1 changed files with 6 additions and 2 deletions
|
@ -103,8 +103,12 @@ def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None):
|
|||
_winapi.PROCESS_DUP_HANDLE, False, parent_pid)
|
||||
else:
|
||||
source_process = None
|
||||
new_handle = reduction.duplicate(pipe_handle,
|
||||
source_process=source_process)
|
||||
try:
|
||||
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)
|
||||
else:
|
||||
from . import semaphore_tracker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue