mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-98703: Fix asyncio proactor_events calling _call_connection_lost multiple times (GH-98704)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 8a755423eb)
Co-authored-by: Ken Jin <kenjin@python.org>
This commit is contained in:
parent
5074c35c2a
commit
bb80f6ad92
2 changed files with 4 additions and 0 deletions
|
|
@ -152,6 +152,8 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
|
|||
self._loop.call_soon(self._call_connection_lost, exc)
|
||||
|
||||
def _call_connection_lost(self, exc):
|
||||
if self._called_connection_lost:
|
||||
return
|
||||
try:
|
||||
self._protocol.connection_lost(exc)
|
||||
finally:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Fix :meth:`asyncio.StreamWriter.drain` to call ``protocol.connection_lost``
|
||||
callback only once on Windows.
|
||||
Loading…
Add table
Add a link
Reference in a new issue