bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462) · python/cpython@88bd26a (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 88bd26a

miss-islingtonvstinner

and

authored

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

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ def _fatal_error(self, exc, message='Fatal error on pipe transport'):
110 110 self._force_close(exc)
111 111
112 112 def _force_close(self, exc):
113 -if self._empty_waiter is not None:
113 +if self._empty_waiter is not None and not self._empty_waiter.done():
114 114 if exc is None:
115 115 self._empty_waiter.set_result(None)
116 116 else:
Original file line number Diff line number Diff 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.