summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-05-20 10:08:12 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-05-20 10:08:12 (GMT)
commita58e2c5c4928ae8031ee60a97f2ab4f863aff8cb (patch)
tree71c839803a4015defda1381fdde2980da720cbcf /Lib/subprocess.py
parent7438c612ab02f9dd5c58fef687a5eb4671dfa18c (diff)
downloadcpython-a58e2c5c4928ae8031ee60a97f2ab4f863aff8cb.zip
cpython-a58e2c5c4928ae8031ee60a97f2ab4f863aff8cb.tar.gz
cpython-a58e2c5c4928ae8031ee60a97f2ab4f863aff8cb.tar.bz2
Issue #26741: POSIX implementation of subprocess.Popen._execute_child() now
sets the returncode attribute using the child process exit status when exec failed.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 642c7f2..41a9de1 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1524,9 +1524,14 @@ class Popen(object):
if errpipe_data:
try:
- os.waitpid(self.pid, 0)
+ pid, sts = os.waitpid(self.pid, 0)
+ if pid == self.pid:
+ self._handle_exitstatus(sts)
+ else:
+ self.returncode = sys.maxsize
except ChildProcessError:
pass
+
try:
exception_name, hex_errno, err_msg = (
errpipe_data.split(b':', 2))