Skip to content

Commit a6331b6

Browse files
gh-100348: Fix ref cycle in asyncio._SelectorSocketTransport with _read_ready_cb (#100349)
1 parent 39dfbb2 commit a6331b6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/asyncio/selector_events.py

+4
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,10 @@ def _make_empty_waiter(self):
11331133
def _reset_empty_waiter(self):
11341134
self._empty_waiter = None
11351135

1136+
def close(self):
1137+
self._read_ready_cb = None
1138+
super().close()
1139+
11361140

11371141
class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport):
11381142

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ref cycle in :class:`!asyncio._SelectorSocketTransport` by removing ``_read_ready_cb`` in ``close``.
2+

0 commit comments

Comments
 (0)