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

@ -211,7 +211,8 @@ final:
/* returns 0 if the object is one of Python's internal ones that don't need to be adapted */
static int _need_adapt(PyObject* obj)
{
if (pysqlite_BaseTypeAdapted) {
pysqlite_state *state = pysqlite_get_state(NULL);
if (state->BaseTypeAdapted) {
return 1;
}