(self)
| 436 | |
| 437 | @asyncio.coroutine |
| 438 | def read(self): |
| 439 | if not self._buffer and not self._eof: |
| 440 | if self._exception is not None: |
| 441 | raise self._exception |
| 442 | |
| 443 | assert not self._waiter |
| 444 | self._waiter = asyncio.Future(loop=self._loop) |
| 445 | try: |
| 446 | yield from self._waiter |
| 447 | except (asyncio.CancelledError, asyncio.TimeoutError): |
| 448 | self._waiter = None |
| 449 | raise |
| 450 | |
| 451 | if self._buffer: |
| 452 | data, size = self._buffer.popleft() |
| 453 | self._size -= size |
| 454 | return data |
| 455 | else: |
| 456 | if self._exception is not None: |
| 457 | raise self._exception |
| 458 | else: |
| 459 | raise EofStream |
| 460 | |
| 461 | if PY_35: |
| 462 | @asyncio.coroutine |
no outgoing calls