Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80fda71

Browse files
authored
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
bpo-32622, bpo-35682: Fix asyncio.ProactorEventLoop.sendfile(): don't attempt to set the result of an internal future if it's already done. Fix asyncio _ProactorBasePipeTransport._force_close(): don't set the result of _empty_waiter if it's already done.
1 parent fbf5068 commit 80fda71

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/asyncio/proactor_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _fatal_error(self, exc, message='Fatal error on pipe transport'):
111111
self._force_close(exc)
112112

113113
def _force_close(self, exc):
114-
if self._empty_waiter is not None:
114+
if self._empty_waiter is not None and not self._empty_waiter.done():
115115
if exc is None:
116116
self._empty_waiter.set_result(None)
117117
else:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to set the result
2+
of an internal future if it's already done.

0 commit comments

Comments
 (0)