mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
asyncio: Fix _UnixWritePipeTransport, raise BrokenPipeError when the pipe is
closed, but only if there was pending write
This commit is contained in:
parent
fcfb9461d3
commit
61b3c9bacc
1 changed files with 4 additions and 1 deletions
|
@ -283,6 +283,9 @@ class _UnixWritePipeTransport(selector_events._FlowControlMixin,
|
||||||
|
|
||||||
def _read_ready(self):
|
def _read_ready(self):
|
||||||
# Pipe was closed by peer.
|
# Pipe was closed by peer.
|
||||||
|
if self._buffer:
|
||||||
|
self._close(BrokenPipeError())
|
||||||
|
else:
|
||||||
self._close()
|
self._close()
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue