Skip to content

Commit

Permalink
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vstinner committed Jan 8, 2019
1 parent fbf5068 commit 80fda71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/asyncio/proactor_events.py
Expand Up @@ -111,7 +111,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
@@ -0,0 +1,2 @@
Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to set the result
of an internal future if it's already done.

0 comments on commit 80fda71

Please sign in to comment.