diff options
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r-- | Lib/asyncio/unix_events.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index ac764f8ad5..98fdddeec9 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -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) |