Skip to content

Commit 36da1a7

Browse files
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
(cherry picked from commit 33880b4) Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
1 parent 58088a5 commit 36da1a7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/asyncio/proactor_events.py

+1-1
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:
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)