mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #26741: POSIX implementation of subprocess.Popen._execute_child() now
sets the returncode attribute using the child process exit status when exec failed.
This commit is contained in:
parent
7438c612ab
commit
a58e2c5c49
1 changed files with 6 additions and 1 deletions
|
@ -1524,9 +1524,14 @@ class Popen(object):
|
||||||
|
|
||||||
if errpipe_data:
|
if errpipe_data:
|
||||||
try:
|
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:
|
except ChildProcessError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exception_name, hex_errno, err_msg = (
|
exception_name, hex_errno, err_msg = (
|
||||||
errpipe_data.split(b':', 2))
|
errpipe_data.split(b':', 2))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue