[Python-checkins] bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533)
asvetlov
webhook-mailer at python.org
Thu Nov 26 05:09:28 EST 2020
https://github.com/python/cpython/commit/e3ef4d7f653976ac0ccacc4e3fde06bf0e0f139b
commit: e3ef4d7f653976ac0ccacc4e3fde06bf0e0f139b
branch: master
author: Alex Grönholm <alex.gronholm at nextday.fi>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2020-11-26T12:09:12+02:00
summary:
bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533)
Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>
Co-authored-by: Kyle Stanley <aeros167 at gmail.com>
files:
A Misc/NEWS.d/next/Library/2020-07-18-17-39-28.bpo-41332.QRGmA5.rst
M Lib/asyncio/base_events.py
M Lib/asyncio/events.py
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index b2d446a51fedb..d71d6f72bf3c9 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -1525,14 +1525,6 @@ 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 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}')
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 0dce87b8ecc58..1a20f362ec386 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -418,6 +418,20 @@ async def create_unix_server(
"""
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
index 0000000000000..fa3fb83b9f5e4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-07-18-17-39-28.bpo-41332.QRGmA5.rst
@@ -0,0 +1,2 @@
+Added missing connect_accepted_socket() method to
+``asyncio.AbstractEventLoop``.
More information about the Python-checkins
mailing list