Commit 1a13efb7 authored by Tim Hoffmann's avatar Tim Hoffmann Committed by Stéphane Wirtel

Minor ReST formatting fixes in subprocess docs (#14876)

parent c78dae8d
...@@ -1048,7 +1048,7 @@ calls these functions. ...@@ -1048,7 +1048,7 @@ calls these functions.
Run the command described by *args*. Wait for command to complete, then Run the command described by *args*. Wait for command to complete, then
return the :attr:`~Popen.returncode` attribute. return the :attr:`~Popen.returncode` attribute.
Code needing to capture stdout or stderr should use :func:`run` instead: Code needing to capture stdout or stderr should use :func:`run` instead::
run(...).returncode run(...).returncode
...@@ -1076,7 +1076,7 @@ calls these functions. ...@@ -1076,7 +1076,7 @@ calls these functions.
:exc:`CalledProcessError` object will have the return code in the :exc:`CalledProcessError` object will have the return code in the
:attr:`~CalledProcessError.returncode` attribute. :attr:`~CalledProcessError.returncode` attribute.
Code needing to capture stdout or stderr should use :func:`run` instead: Code needing to capture stdout or stderr should use :func:`run` instead::
run(..., check=True) run(..., check=True)
...@@ -1198,8 +1198,8 @@ becomes:: ...@@ -1198,8 +1198,8 @@ becomes::
p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits. p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
output = p2.communicate()[0] output = p2.communicate()[0]
The p1.stdout.close() call after starting the p2 is important in order for p1 The ``p1.stdout.close()`` call after starting the p2 is important in order for
to receive a SIGPIPE if p2 exits before p1. p1 to receive a SIGPIPE if p2 exits before p1.
Alternatively, for trusted input, the shell's own pipeline support may still Alternatively, for trusted input, the shell's own pipeline support may still
be used directly: be used directly:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment