Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
(cherry picked from commit 80fda71)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
  • Loading branch information
vstinner authored and miss-islington committed Jan 8, 2019
commit 51ba5209c18b5a4c9ff86b9556d99d4726cb18c6
2 changes: 1 addition & 1 deletion Lib/asyncio/proactor_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _fatal_error(self, exc, message='Fatal error on pipe transport'):
self._force_close(exc)

def _force_close(self, exc):
if self._empty_waiter is not None:
if self._empty_waiter is not None and not self._empty_waiter.done():
if exc is None:
self._empty_waiter.set_result(None)
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to set the result
of an internal future if it's already done.