Issue #22274: Merge stderr=STDOUT fix from 3.5

This commit is contained in:
Martin Panter 2016-05-13 07:45:21 +00:00
commit f94ec1bd83
3 changed files with 28 additions and 1 deletions

View file

@ -1412,7 +1412,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):