mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Applied patch 1669481, slightly modified: Support close_fds on Win32
This commit is contained in:
parent
5f9b6c9a1b
commit
81a191b351
3 changed files with 16 additions and 6 deletions
|
@ -545,9 +545,10 @@ class Popen(object):
|
|||
if preexec_fn is not None:
|
||||
raise ValueError("preexec_fn is not supported on Windows "
|
||||
"platforms")
|
||||
if close_fds:
|
||||
if close_fds and (stdin is not None or stdout is not None or
|
||||
stderr is not None):
|
||||
raise ValueError("close_fds is not supported on Windows "
|
||||
"platforms")
|
||||
"platforms if you redirect stdin/stdout/stderr")
|
||||
else:
|
||||
# POSIX
|
||||
if startupinfo is not None:
|
||||
|
@ -804,9 +805,7 @@ class Popen(object):
|
|||
hp, ht, pid, tid = CreateProcess(executable, args,
|
||||
# no special security
|
||||
None, None,
|
||||
# must inherit handles to pass std
|
||||
# handles
|
||||
1,
|
||||
int(not close_fds),
|
||||
creationflags,
|
||||
env,
|
||||
cwd,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue