cpython: f2d13349ea5d (original) (raw)

Mercurial > cpython

changeset 101638:f2d13349ea5d

Issue #27167: Clarify the subprocess.CalledProcessError error message text when the child process died due to a signal. [#27167]

Gregory P. Smith greg@krypto.org [Google Inc.]
date Fri, 03 Jun 2016 06:14:06 +0000
parents 015b86646d8e
children 1022d09d11e5
files Lib/subprocess.py Lib/test/test_subprocess.py Misc/NEWS
diffstat 3 files changed, 37 insertions(+), 4 deletions(-)[+] [-] Lib/subprocess.py 19 Lib/test/test_subprocess.py 19 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -372,9 +372,11 @@ class SubprocessError(Exception): pass class CalledProcessError(SubprocessError):

+

+ check_output() will also store the output in the output attribute. """ def init(self, returncode, cmd, output=None, stderr=None): @@ -384,7 +386,16 @@ class CalledProcessError(SubprocessError self.stderr = stderr def str(self):

@property def stdout(self):

--- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1427,6 +1427,25 @@ class POSIXProcessTestCase(BaseTestCase) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT)

+

+

+ def test_preexec(self): # DISCLAIMER: Setting environment variables is not a good use # of a preexec_fn. This is merely a test.

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,9 @@ Core and Builtins Library ------- +- Issue #27167: Clarify the subprocess.CalledProcessError error message text