mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-42064: Move sqlite3 types to global state (GH-26537)
* Move connection type to global state * Move cursor type to global state * Move prepare protocol type to global state * Move row type to global state * Move statement type to global state * ADD_TYPE takes a pointer * pysqlite_get_state is now static inline
This commit is contained in:
parent
8ebd9447e9
commit
10a5c806d4
12 changed files with 103 additions and 70 deletions
|
@ -58,8 +58,8 @@ pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
|
|||
PyObject* key;
|
||||
int rc;
|
||||
|
||||
if (proto == NULL) proto = (PyObject*)pysqlite_PrepareProtocolType;
|
||||
|
||||
assert(type != NULL);
|
||||
assert(proto != NULL);
|
||||
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
|
||||
if (!key) {
|
||||
return -1;
|
||||
|
@ -81,7 +81,7 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
|
|||
PyObject *adapter, *key, *adapted;
|
||||
|
||||
/* we don't check for exact type conformance as specified in PEP 246
|
||||
because the pysqlite_PrepareProtocolType type is abstract and there is no
|
||||
because the PrepareProtocolType type is abstract and there is no
|
||||
way to get a quotable object to be its instance */
|
||||
|
||||
/* look for an adapter in the registry */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue