bpo-42064: Move sqlite3 exceptions to global state, part 2 of 2 (GH-26884)

Automerge-Triggered-By: GH:encukou
This commit is contained in:
Erlend Egeberg Aasland 2021-07-14 13:26:44 +02:00 committed by GitHub
parent e5862f79c1
commit 05162993fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 90 additions and 92 deletions

View file

@ -143,6 +143,7 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
return Py_NewRef(alt);
}
/* else set the right exception and return NULL */
PyErr_SetString(pysqlite_ProgrammingError, "can't adapt");
pysqlite_state *state = pysqlite_get_state(NULL);
PyErr_SetString(state->ProgrammingError, "can't adapt");
return NULL;
}