| 1639 | self._stmts_to_close.add(stmt) |
| 1640 | |
| 1641 | async def _cleanup_stmts(self): |
| 1642 | # Called whenever we create a new prepared statement in |
| 1643 | # `Connection._get_statement()` and `_stmts_to_close` is |
| 1644 | # not empty. |
| 1645 | to_close = self._stmts_to_close |
| 1646 | self._stmts_to_close = set() |
| 1647 | for stmt in to_close: |
| 1648 | # It is imperative that statements are cleaned properly, |
| 1649 | # so we ignore the timeout. |
| 1650 | await self._protocol.close_statement(stmt, protocol.NO_TIMEOUT) |
| 1651 | |
| 1652 | async def _cancel(self, waiter): |
| 1653 | try: |