bpo-42064: Finalise establishing sqlite3 global state (GH-27155)

With this, all sqlite3 static globals have been moved to the global state.
There are a couple of global static strings left, but there should be no need for adding them to the state.

https://bugs.python.org/issue42064
This commit is contained in:
Erlend Egeberg Aasland 2021-07-20 12:59:18 +02:00 committed by GitHub
parent 366fcbac18
commit 4c0deb25ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 53 deletions

View file

@ -41,7 +41,17 @@ typedef struct {
PyObject *ProgrammingError;
PyObject *Warning;
/* A dictionary, mapping column types (INTEGER, VARCHAR, etc.) to converter
* functions, that convert the SQL value to the appropriate Python value.
* The key is uppercase.
*/
PyObject *converters;
PyObject *lru_cache;
PyObject *psyco_adapters; // The adapters registry
int BaseTypeAdapted;
int enable_callback_tracebacks;
PyTypeObject *ConnectionType;
PyTypeObject *CursorType;
@ -58,15 +68,6 @@ pysqlite_get_state(PyObject *Py_UNUSED(module))
return &pysqlite_global_state;
}
/* A dictionary, mapping column types (INTEGER, VARCHAR, etc.) to converter
* functions, that convert the SQL value to the appropriate Python value.
* The key is uppercase.
*/
extern PyObject* _pysqlite_converters;
extern int _pysqlite_enable_callback_tracebacks;
extern int pysqlite_BaseTypeAdapted;
#define PARSE_DECLTYPES 1
#define PARSE_COLNAMES 2
#endif