Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4a09ab

Browse files
committed
Issue #15501: Document exception classes in subprocess module.
Initial patch by Anton Barkovsky.
1 parent e939f38 commit b4a09ab

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Doc/library/subprocess.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,54 @@ use cases, the underlying :class:`Popen` interface can be used directly.
208208
output.
209209

210210

211+
.. exception:: SubprocessError
212+
213+
Base class for all other exceptions from this module.
214+
215+
.. versionadded:: 3.3
216+
217+
218+
.. exception:: TimeoutExpired
219+
220+
Subclass of :exc:`SubprocessError`, raised when a timeout expires
221+
while waiting for a child process.
222+
223+
.. attribute:: cmd
224+
225+
Command that was used to spawn the child process.
226+
227+
.. attribute:: timeout
228+
229+
Timeout in seconds.
230+
231+
.. attribute:: output
232+
233+
Output of the child process if this exception is raised by
234+
:func:`check_output`. Otherwise, ``None``.
235+
236+
.. versionadded:: 3.3
237+
238+
239+
.. exception:: CalledProcessError
240+
241+
Subclass of :exc:`SubprocessError`, raised when a process run by
242+
:func:`check_call` or :func:`check_output` returns a non-zero exit status.
243+
244+
.. attribute:: returncode
245+
246+
Exit status of the child process.
247+
248+
.. attribute:: cmd
249+
250+
Command that was used to spawn the child process.
251+
252+
.. attribute:: output
253+
254+
Output of the child process if this exception is raised by
255+
:func:`check_output`. Otherwise, ``None``.
256+
257+
258+
211259
.. _frequently-used-arguments:
212260

213261
Frequently Used Arguments

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Matt Bandy
5656
Michael J. Barber
5757
Nicolas Bareil
5858
Chris Barker
59+
Anton Barkovsky
5960
Nick Barnes
6061
Quentin Barnes
6162
David Barnett

0 commit comments

Comments
 (0)