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

Skip to content

Commit 4270a24

Browse files
committed
asyncio doc: document BaseSubprocessTransport.close() method
Modify also the get_pipe_transport() doc to mention explicitly the supported file descriptors.
1 parent e6f8c50 commit 4270a24

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

Doc/library/asyncio-protocol.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,15 @@ BaseSubprocessTransport
207207
.. method:: get_pipe_transport(fd)
208208

209209
Return the transport for the communication pipe corresponding to the
210-
integer file descriptor *fd*. The return value can be a readable or
211-
writable streaming transport, depending on the *fd*. If *fd* doesn't
212-
correspond to a pipe belonging to this transport, :const:`None` is
213-
returned.
210+
integer file descriptor *fd*:
211+
212+
* ``0``: readable streaming transport of the standard input (*stdin*),
213+
or :const:`None` if the subprocess was not created with ``stdin=PIPE``
214+
* ``1``: writable streaming transport of the standard output (*stdout*),
215+
or :const:`None` if the subprocess was not created with ``stdout=PIPE``
216+
* ``2``: writable streaming transport of the standard error (*stderr*),
217+
or :const:`None` if the subprocess was not created with ``stderr=PIPE``
218+
* other *fd*: :const:`None`
214219

215220
.. method:: get_returncode()
216221

@@ -239,6 +244,12 @@ BaseSubprocessTransport
239244
On Windows, the Windows API function TerminateProcess() is called to
240245
stop the subprocess.
241246

247+
.. method:: close()
248+
249+
Ask the subprocess to stop by calling the :meth:`terminate` method if the
250+
subprocess hasn't returned yet, and close transports of all pipes
251+
(*stdin*, *stdout* and *stderr*).
252+
242253

243254
.. _asyncio-protocol:
244255

0 commit comments

Comments
 (0)