]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533)
authorAlex Grönholm <alex.gronholm@nextday.fi>
Thu, 26 Nov 2020 10:09:12 +0000 (12:09 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Nov 2020 10:09:12 +0000 (12:09 +0200)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Lib/asyncio/base_events.py
Lib/asyncio/events.py
Misc/NEWS.d/next/Library/2020-07-18-17-39-28.bpo-41332.QRGmA5.rst [new file with mode: 0644]

index b2d446a51fedb50a75b7c72ba093799705e99257..d71d6f72bf3c9107c57f4ed441c4d840b8b866d8 100644 (file)
@@ -1525,14 +1525,6 @@ class BaseEventLoop(events.AbstractEventLoop):
             self, protocol_factory, sock,
             *, ssl=None,
             ssl_handshake_timeout=None):
-        """Handle an accepted connection.
-
-        This is used by servers that accept connections outside of
-        asyncio but that use asyncio to handle connections.
-
-        This method is a coroutine.  When completed, the coroutine
-        returns a (transport, protocol) pair.
-        """
         if sock.type != socket.SOCK_STREAM:
             raise ValueError(f'A Stream Socket was expected, got {sock!r}')
 
index 0dce87b8ecc5861a254dbd1aaffb2f7c3a6e6953..1a20f362ec38691266999065fa4e7f41f4d4a8fd 100644 (file)
@@ -418,6 +418,20 @@ class AbstractEventLoop:
         """
         raise NotImplementedError
 
+    async def connect_accepted_socket(
+            self, protocol_factory, sock,
+            *, ssl=None,
+            ssl_handshake_timeout=None):
+        """Handle an accepted connection.
+
+        This is used by servers that accept connections outside of
+        asyncio, but use asyncio to handle connections.
+
+        This method is a coroutine.  When completed, the coroutine
+        returns a (transport, protocol) pair.
+        """
+        raise NotImplementedError
+
     async def create_datagram_endpoint(self, protocol_factory,
                                        local_addr=None, remote_addr=None, *,
                                        family=0, proto=0, flags=0,
diff --git a/Misc/NEWS.d/next/Library/2020-07-18-17-39-28.bpo-41332.QRGmA5.rst b/Misc/NEWS.d/next/Library/2020-07-18-17-39-28.bpo-41332.QRGmA5.rst
new file mode 100644 (file)
index 0000000..fa3fb83
--- /dev/null
@@ -0,0 +1,2 @@
+Added missing connect_accepted_socket() method to
+``asyncio.AbstractEventLoop``.