(self)
| 1618 | self._clean_tasks() |
| 1619 | |
| 1620 | def _clean_tasks(self): |
| 1621 | # Wrap-up any remaining tasks associated with this connection. |
| 1622 | if self._cancellations: |
| 1623 | current = asyncio.current_task(self._loop) |
| 1624 | for fut in self._cancellations: |
| 1625 | if fut is not current and not fut.done(): |
| 1626 | fut.cancel() |
| 1627 | self._cancellations.clear() |
| 1628 | |
| 1629 | def _check_open(self): |
| 1630 | if self.is_closed(): |