diff options
author | Peter Astrand <astrand@lysator.liu.se> | 2007-05-26 22:18:20 +0000 |
---|---|---|
committer | Peter Astrand <astrand@lysator.liu.se> | 2007-05-26 22:18:20 +0000 |
commit | 81a191b3510bbed302cb0a766bc6966cb4effaca (patch) | |
tree | e5c4438e52d5fe183db39d45ebddc34c56742f8b /Lib/subprocess.py | |
parent | 5f9b6c9a1bc1c6aa1b07db52c8b851bb7e798f7a (diff) | |
download | cpython-git-81a191b3510bbed302cb0a766bc6966cb4effaca.tar.gz |
Applied patch 1669481, slightly modified: Support close_fds on Win32
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 745c48306b..ca9489e67d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -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, |