Commit dee457e
committed
Close DB connection when Database is garbage collected
Register a weakref.finalize callback to close the underlying DB
connection when the Database instance is garbage collected.
This address a ResourceWarning which was introduced in Python 3.13
(python/cpython#105539).1 parent a83d418 commit dee457e
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
| 191 | + | |
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
| |||
0 commit comments