summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-10-29 16:43:42 (GMT)
committerGitHub <noreply@github.com>2022-10-29 16:43:42 (GMT)
commit9bdec0aa4516650e51b998418fb6188427137fed (patch)
tree13a0051546bcae84c1fdaa9bf8800f58c4e6baf7
parentc0f2a5ef9125f2b44b32cab92e1b0b1bfe0e3fdc (diff)
downloadcpython-9bdec0aa4516650e51b998418fb6188427137fed.zip
cpython-9bdec0aa4516650e51b998418fb6188427137fed.tar.gz
cpython-9bdec0aa4516650e51b998418fb6188427137fed.tar.bz2
GH-90352: fix _SelectorDatagramTransport to inherit from DatagramTransport (#98844)
-rw-r--r--Lib/asyncio/selector_events.py2
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py4
-rw-r--r--Misc/NEWS.d/next/Library/2022-10-29-09-42-20.gh-issue-90352.t8QEPt.rst1
3 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index d2ee49d..bfa4590 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -1126,7 +1126,7 @@ class _SelectorSocketTransport(_SelectorTransport):
self._empty_waiter = None
-class _SelectorDatagramTransport(_SelectorTransport):
+class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport):
_buffer_factory = collections.deque
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 796037b..ca55538 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -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()
diff --git a/Misc/NEWS.d/next/Library/2022-10-29-09-42-20.gh-issue-90352.t8QEPt.rst b/Misc/NEWS.d/next/Library/2022-10-29-09-42-20.gh-issue-90352.t8QEPt.rst
new file mode 100644
index 0000000..8e80eae
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-10-29-09-42-20.gh-issue-90352.t8QEPt.rst
@@ -0,0 +1 @@
+Fix ``_SelectorDatagramTransport`` to inherit from :class:`~asyncio.DatagramTransport` in :mod:`asyncio`. Patch by Kumar Aditya.