summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-13 07:45:21 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-13 07:45:21 (GMT)
commitf94ec1bd832831186e309afbec60ac1ed0200564 (patch)
treeab76afcf8f48ce5115abc852a00d73d40e468913 /Lib/subprocess.py
parent99740925ed5472e0c0c22ee01d0f2250d9287ff9 (diff)
parentc76358924f5d750460f8693c05987dd866cb9e8a (diff)
downloadcpython-f94ec1bd832831186e309afbec60ac1ed0200564.zip
cpython-f94ec1bd832831186e309afbec60ac1ed0200564.tar.gz
cpython-f94ec1bd832831186e309afbec60ac1ed0200564.tar.bz2
Issue #22274: Merge stderr=STDOUT fix from 3.5
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index e980349..642c7f2 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -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):