(self)
| 1009 | """ |
| 1010 | |
| 1011 | def close(self) -> None: |
| 1012 | if pool := getattr(self, "_pool", None): |
| 1013 | # Connection currently checked out from the pool. |
| 1014 | # Instead of closing it, return it to the pool. |
| 1015 | pool.putconn(self) |
| 1016 | else: |
| 1017 | # Connection not part of any pool, or currently into the pool. |
| 1018 | # Close the connection for real. |
| 1019 | super().close() |
| 1020 | |
| 1021 | |
| 1022 | def test_override_close(dsn): |
no test coverage detected