]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
authorOleg Iarygin <oleg@arhadthedev.net>
Tue, 17 May 2022 22:27:32 +0000 (01:27 +0300)
committerGitHub <noreply@github.com>
Tue, 17 May 2022 22:27:32 +0000 (23:27 +0100)
Lib/asyncio/proactor_events.py
Misc/NEWS.d/next/Windows/2022-05-16-11-45-06.gh-issue-92841.NQx107.rst [new file with mode: 0644]

index 9636c6b4d28fad5ecd7cc2bbb6619ba959fd7406..ddb9daca0269367901e463fd41a60bbeb5db937b 100644 (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:
diff --git a/Misc/NEWS.d/next/Windows/2022-05-16-11-45-06.gh-issue-92841.NQx107.rst b/Misc/NEWS.d/next/Windows/2022-05-16-11-45-06.gh-issue-92841.NQx107.rst
new file mode 100644 (file)
index 0000000..5e1897e
--- /dev/null
@@ -0,0 +1,2 @@
+:mod:`asyncio` no longer throws ``RuntimeError: Event loop is closed`` on
+interpreter exit after asynchronous socket activity. Patch by Oleg Iarygin.