mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira Li
This commit is contained in:
parent
07451ddd4f
commit
c76358924f
3 changed files with 28 additions and 1 deletions
|
@ -1401,7 +1401,10 @@ class Popen(object):
|
|||
elif stderr == PIPE:
|
||||
errread, errwrite = os.pipe()
|
||||
elif stderr == STDOUT:
|
||||
errwrite = c2pwrite
|
||||
if c2pwrite != -1:
|
||||
errwrite = c2pwrite
|
||||
else: # child's stdout is not set, use parent's stdout
|
||||
errwrite = sys.__stdout__.fileno()
|
||||
elif stderr == DEVNULL:
|
||||
errwrite = self._get_devnull()
|
||||
elif isinstance(stderr, int):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue