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
|
@ -31,9 +31,20 @@
|
|||
|
||||
typedef struct {
|
||||
PyObject *lru_cache;
|
||||
PyTypeObject *ConnectionType;
|
||||
PyTypeObject *CursorType;
|
||||
PyTypeObject *PrepareProtocolType;
|
||||
PyTypeObject *RowType;
|
||||
PyTypeObject *StatementType;
|
||||
} pysqlite_state;
|
||||
|
||||
extern pysqlite_state *pysqlite_get_state(PyObject *module);
|
||||
extern pysqlite_state pysqlite_global_state;
|
||||
|
||||
static inline pysqlite_state *
|
||||
pysqlite_get_state(PyObject *Py_UNUSED(module))
|
||||
{
|
||||
return &pysqlite_global_state;
|
||||
}
|
||||
|
||||
extern PyObject* pysqlite_Error;
|
||||
extern PyObject* pysqlite_Warning;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue