mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)
The sqlite3 module now fully implements the GC protocol, so there's no need for this workaround anymore. - Add and use managed resource helper for connections using TESTFN - Sort test imports - Split open-tests into their own test case Automerge-Triggered-By: GH:vstinner
This commit is contained in:
parent
2c1e2583fd
commit
d88b47b5a3
5 changed files with 37 additions and 39 deletions
|
@ -149,14 +149,6 @@ pysqlite_connection_init(pysqlite_Connection *self, PyObject *args,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* By default, the Cache class INCREFs the factory in its initializer, and
|
||||
* decrefs it in its deallocator method. Since this would create a circular
|
||||
* reference here, we're breaking it by decrementing self, and telling the
|
||||
* cache class to not decref the factory (self) in its deallocator.
|
||||
*/
|
||||
self->statement_cache->decref_factory = 0;
|
||||
Py_DECREF(self);
|
||||
|
||||
self->detect_types = detect_types;
|
||||
self->timeout = timeout;
|
||||
(void)sqlite3_busy_timeout(self->db, (int)(timeout*1000));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue