[Python-checkins] Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (GH-31512) (GH-31514)

asvetlov webhook-mailer at python.org
Wed Feb 23 07:05:26 EST 2022


https://github.com/python/cpython/commit/6717edcf84077440a8839f2086cc5c5e2fc779c5
commit: 6717edcf84077440a8839f2086cc5c5e2fc779c5
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2022-02-23T14:04:49+02:00
summary:

Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (GH-31512) (GH-31514)

(cherry picked from commit cff4d5c5d29528299ec1ac5b3b3a6f7735577c01)

Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>

Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>

files:
A Misc/NEWS.d/next/Library/2022-02-23-00-55-59.bpo-44886.I40Mbr.rst
M Lib/asyncio/proactor_events.py
M Lib/test/test_asyncio/test_proactor_events.py

diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 45c11ee4b487e..e551896395b84 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -452,7 +452,8 @@ def _pipe_closed(self, fut):
             self.close()
 
 
-class _ProactorDatagramTransport(_ProactorBasePipeTransport):
+class _ProactorDatagramTransport(_ProactorBasePipeTransport,
+                                 transports.DatagramTransport):
     max_size = 256 * 1024
     def __init__(self, loop, sock, protocol, address=None,
                  waiter=None, extra=None):
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
index 4c8906d531ce5..c024477e3baba 100644
--- a/Lib/test/test_asyncio/test_proactor_events.py
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -838,6 +838,7 @@ def datagram_transport(self):
     def test_make_datagram_transport(self):
         tr = self.datagram_transport()
         self.assertIsInstance(tr, _ProactorDatagramTransport)
+        self.assertIsInstance(tr, asyncio.DatagramTransport)
         close_transport(tr)
 
     def test_datagram_loop_writing(self):
diff --git a/Misc/NEWS.d/next/Library/2022-02-23-00-55-59.bpo-44886.I40Mbr.rst b/Misc/NEWS.d/next/Library/2022-02-23-00-55-59.bpo-44886.I40Mbr.rst
new file mode 100644
index 0000000000000..be223ddd58ba1
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-02-23-00-55-59.bpo-44886.I40Mbr.rst
@@ -0,0 +1,2 @@
+Inherit asyncio proactor datagram transport from
+:class:`asyncio.DatagramTransport`.



More information about the Python-checkins mailing list