]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (#31512)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Tue, 22 Feb 2022 23:39:24 +0000 (01:39 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Feb 2022 23:39:24 +0000 (01:39 +0200)
Lib/asyncio/proactor_events.py
Lib/test/test_asyncio/test_proactor_events.py
Misc/NEWS.d/next/Library/2022-02-23-00-55-59.bpo-44886.I40Mbr.rst [new file with mode: 0644]

index ae59f30db1c3c91b82acd35aaf581c6a22cece89..43d5e70b79cac6eaab0f555043c161c090e38d89 100644 (file)
@@ -452,7 +452,8 @@ class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport):
             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):
index 45af8101a00932c9d5f71579e2b3d03585ebda9a..67573823ecb22229d4bc0bfaf2f6b8f7bad32bc5 100644 (file)
@@ -839,6 +839,7 @@ class BaseProactorEventLoopTests(test_utils.TestCase):
     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 (file)
index 0000000..be223dd
--- /dev/null
@@ -0,0 +1,2 @@
+Inherit asyncio proactor datagram transport from
+:class:`asyncio.DatagramTransport`.