[Python-checkins] cpython (2.7): Issue #15501: Document exception classes in subprocess module.

andrew.svetlov python-checkins at python.org
Thu Aug 9 14:28:03 CEST 2012


http://hg.python.org/cpython/rev/9c99f31a9c2a
changeset:   78477:9c99f31a9c2a
branch:      2.7
parent:      78461:db1b4aab53eb
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Thu Aug 09 15:23:49 2012 +0300
summary:
  Issue #15501: Document exception classes in subprocess module.

Initial patch by Anton Barkovsky.

files:
  Doc/library/subprocess.rst |  20 ++++++++++++++++++++
  Misc/ACKS                  |   1 +
  2 files changed, 21 insertions(+), 0 deletions(-)


diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -172,6 +172,26 @@
    output.
 
 
+.. exception:: CalledProcessError
+
+    Exception raised when a process run by :func:`check_call` or
+    :func:`check_output` returns a non-zero exit status.
+
+    .. attribute:: returncode
+
+        Exit status of the child process.
+
+    .. attribute:: cmd
+
+        Command that was used to spawn the child process.
+
+    .. attribute:: output
+
+        Output of the child process if this exception is raised by
+        :func:`check_output`.  Otherwise, ``None``.
+
+
+
 .. _frequently-used-arguments:
 
 Frequently Used Arguments
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -44,6 +44,7 @@
 Matt Bandy
 Michael J. Barber
 Chris Barker
+Anton Barkovsky
 Nick Barnes
 Quentin Barnes
 Richard Barran

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list