]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (GH-31512)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 23 Feb 2022 00:08:43 +0000 (16:08 -0800)
committerGitHub <noreply@github.com>
Wed, 23 Feb 2022 00:08:43 +0000 (16:08 -0800)
(cherry picked from commit cff4d5c5d29528299ec1ac5b3b3a6f7735577c01)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
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 b4cd414b82d72798a03553732ba47109df6c92aa..6762253abc967826789a061caeabe7e32294e7fe 100644 (file)
@@ -450,7 +450,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 59d5e5b6ccb631a42ec6d6958dfe9b0ca10301fe..1bbb487626e89e35189bf34e9a8f00349439087f 100644 (file)
@@ -823,6 +823,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`.