(self)
| 50 | """ |
| 51 | |
| 52 | def close(self) -> None: |
| 53 | if pool := getattr(self, "_pool", None): |
| 54 | # Connection currently checked out from the pool. |
| 55 | # Instead of closing it, return it to the pool. |
| 56 | pool.putconn(self) |
| 57 | else: |
| 58 | # Connection not part of any pool, or currently into the pool. |
| 59 | # Close the connection for real. |
| 60 | super().close() |
| 61 | |
| 62 | |
| 63 | __all__ = [ |