GH-90352: fix _SelectorDatagramTransport to inherit from DatagramTransport (#98844)

This commit is contained in:
Kumar Aditya 2022-10-29 22:13:42 +05:30 committed by GitHub
parent c0f2a5ef91
commit 9bdec0aa45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -1126,7 +1126,7 @@ class _SelectorSocketTransport(_SelectorTransport):
self._empty_waiter = None
class _SelectorDatagramTransport(_SelectorTransport):
class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport):
_buffer_factory = collections.deque

View File

@ -1081,6 +1081,10 @@ class SelectorDatagramTransportTests(test_utils.TestCase):
self.protocol.datagram_received.assert_called_with(
b'data', ('0.0.0.0', 1234))
def test_transport_inheritance(self):
transport = self.datagram_transport()
self.assertIsInstance(transport, asyncio.DatagramTransport)
def test_read_ready_tryagain(self):
transport = self.datagram_transport()

View File

@ -0,0 +1 @@
Fix ``_SelectorDatagramTransport`` to inherit from :class:`~asyncio.DatagramTransport` in :mod:`asyncio`. Patch by Kumar Aditya.