Skip to content

Commit

Permalink
debug: announce when closing a connection
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Oct 19, 2023
1 parent 621f373 commit a97525f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coverage/sqlitedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def _connect(self) -> None:
def close(self) -> None:
"""If needed, close the connection."""
if self.con is not None and self.filename != ":memory:":
if self.debug.should("sql"):
self.debug.write(f"Closing {self.con!r} on {self.filename!r}")
self.con.close()
self.con = None

Expand Down

0 comments on commit a97525f

Please sign in to comment.