bpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types (GH-22478)

This commit is contained in:
Erlend Egeberg Aasland 2020-10-01 16:03:21 +02:00 committed by GitHub
parent 9031bd4fa4
commit 256e54acdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 74 additions and 102 deletions

View file

@ -82,7 +82,7 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
}
if (factory == NULL) {
factory = (PyObject*)&pysqlite_ConnectionType;
factory = (PyObject*)pysqlite_ConnectionType;
}
if (PySys_Audit("sqlite3.connect", "O", database) < 0) {
@ -353,8 +353,8 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
if (!module ||
(pysqlite_row_setup_types(module) < 0) ||
(pysqlite_cursor_setup_types() < 0) ||
(pysqlite_connection_setup_types() < 0) ||
(pysqlite_cursor_setup_types(module) < 0) ||
(pysqlite_connection_setup_types(module) < 0) ||
(pysqlite_cache_setup_types(module) < 0) ||
(pysqlite_statement_setup_types(module) < 0) ||
(pysqlite_prepare_protocol_setup_types(module) < 0)
@ -363,8 +363,8 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
return NULL;
}
ADD_TYPE(module, pysqlite_ConnectionType);
ADD_TYPE(module, pysqlite_CursorType);
ADD_TYPE(module, *pysqlite_ConnectionType);
ADD_TYPE(module, *pysqlite_CursorType);
ADD_TYPE(module, *pysqlite_PrepareProtocolType);
ADD_TYPE(module, *pysqlite_RowType);