gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)

(cherry picked from commit 33880b4b1c)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
Miss Islington (bot) 2022-05-17 15:59:29 -07:00 committed by GitHub
parent 58088a544c
commit 36da1a77c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -113,7 +113,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
def __del__(self, _warn=warnings.warn):
if self._sock is not None:
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
self.close()
self._sock.close()
def _fatal_error(self, exc, message='Fatal error on pipe transport'):
try: