]> 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 12:04:49 +0000 (04:04 -0800)
committerGitHub <noreply@github.com>
Wed, 23 Feb 2022 12:04:49 +0000 (14:04 +0200)
(cherry picked from commit cff4d5c5d29528299ec1ac5b3b3a6f7735577c01)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
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 45c11ee4b487ecb6e962d269b200524d81dd9820..e551896395b84df7b722c5feb81e739b1adbe3ab 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 4c8906d531ce5cc0318524740e08e123d300d6c4..c024477e3bababcf906240ed1e54190baff5aaf0 100644 (file)
@@ -838,6 +838,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`.