mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +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,7 +283,10 @@ class _UnixWritePipeTransport(selector_events._FlowControlMixin,
|
|||
|
||||
def _read_ready(self):
|
||||
# Pipe was closed by peer.
|
||||
self._close()
|
||||
if self._buffer:
|
||||
self._close(BrokenPipeError())
|
||||
else:
|
||||
self._close()
|
||||
|
||||
def write(self, data):
|
||||
assert isinstance(data, (bytes, bytearray, memoryview)), repr(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue