Skip to content

Commit 33880b4

Browse files
authored
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
1 parent 6b932cb commit 33880b4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/asyncio/proactor_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def close(self):
113113
def __del__(self, _warn=warnings.warn):
114114
if self._sock is not None:
115115
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
116-
self.close()
116+
self._sock.close()
117117

118118
def _fatal_error(self, exc, message='Fatal error on pipe transport'):
119119
try:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:mod:`asyncio` no longer throws ``RuntimeError: Event loop is closed`` on
2+
interpreter exit after asynchronous socket activity. Patch by Oleg Iarygin.

0 commit comments

Comments
 (0)