summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-31 12:04:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-31 12:04:28 (GMT)
commit61b3c9bacc51a2dbf8baa4f55b812f33b32a2692 (patch)
tree7bc46615cea515abfa69531a081c83738dc313d2 /Lib/asyncio/unix_events.py
parentfcfb9461d3cb726b3badee8ffdb6034f19882330 (diff)
downloadcpython-61b3c9bacc51a2dbf8baa4f55b812f33b32a2692.zip
cpython-61b3c9bacc51a2dbf8baa4f55b812f33b32a2692.tar.gz
cpython-61b3c9bacc51a2dbf8baa4f55b812f33b32a2692.tar.bz2
asyncio: Fix _UnixWritePipeTransport, raise BrokenPipeError when the pipe is
closed, but only if there was pending write
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r--Lib/asyncio/unix_events.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index ac764f8..98fddde 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)