From: Victor Stinner Date: Wed, 28 May 2014 22:14:03 +0000 (+0200) Subject: Issue #21454: Fix asyncio.BaseEventLoop.connect_read_pipe doc X-Git-Tag: v3.4.2rc1~484 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5b257af22976b9fdeb1907f8d0c50ef9b97facb;p=python Issue #21454: Fix asyncio.BaseEventLoop.connect_read_pipe doc The function sets the the pipe to non-blocking mode. --- diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 835266f7eb..b961260e35 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -455,11 +455,11 @@ Connect pipes .. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe) - Register read pipe in eventloop. + Register read pipe in eventloop. Set the *pipe* to non-blocking mode. *protocol_factory* should instantiate object with :class:`Protocol` - interface. pipe is file-like object already switched to nonblocking. - Return pair (transport, protocol), where transport support + interface. *pipe* is a :term:`file-like object `. + Return pair ``(transport, protocol)``, where *transport* supports the :class:`ReadTransport` interface. This method is a :ref:`coroutine `. diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 31592d10b1..f0ad568052 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -257,11 +257,11 @@ class AbstractEventLoop: # Pipes and subprocesses. def connect_read_pipe(self, protocol_factory, pipe): - """Register read pipe in event loop. + """Register read pipe in event loop. Set the pipe to non-blocking mode. protocol_factory should instantiate object with Protocol interface. - pipe is file-like object already switched to nonblocking. - Return pair (transport, protocol), where transport support + pipe is a file-like object. + Return pair (transport, protocol), where transport supports the ReadTransport interface.""" # The reason to accept file-like object instead of just file descriptor # is: we need to own pipe and close it at transport finishing