mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -13,15 +13,15 @@ pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
pysqlite_Cursor *cursor;
|
||||
PyObject *data;
|
||||
|
||||
if ((type == pysqlite_RowType) &&
|
||||
if ((type == clinic_state()->RowType) &&
|
||||
!_PyArg_NoKeywords("Row", kwargs)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!_PyArg_CheckPositional("Row", PyTuple_GET_SIZE(args), 2, 2)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), pysqlite_CursorType)) {
|
||||
_PyArg_BadArgument("Row", "argument 1", (pysqlite_CursorType)->tp_name, PyTuple_GET_ITEM(args, 0));
|
||||
if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->CursorType)) {
|
||||
_PyArg_BadArgument("Row", "argument 1", (clinic_state()->CursorType)->tp_name, PyTuple_GET_ITEM(args, 0));
|
||||
goto exit;
|
||||
}
|
||||
cursor = (pysqlite_Cursor *)PyTuple_GET_ITEM(args, 0);
|
||||
|
@ -53,4 +53,4 @@ pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return pysqlite_row_keys_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=8d29220b9cde035d input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=0382771b4fc85f36 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue