mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Update to pysqlite 2.2.0
This commit is contained in:
parent
a058836e96
commit
72289a616c
17 changed files with 592 additions and 134 deletions
|
@ -45,9 +45,7 @@ microprotocols_init(PyObject *dict)
|
|||
return -1;
|
||||
}
|
||||
|
||||
PyDict_SetItemString(dict, "adapters", psyco_adapters);
|
||||
|
||||
return 0;
|
||||
return PyDict_SetItemString(dict, "adapters", psyco_adapters);
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,8 +63,17 @@ microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
|
|||
cast, type->tp_name);
|
||||
*/
|
||||
|
||||
|
||||
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
|
||||
PyDict_SetItem(psyco_adapters, key, cast);
|
||||
if (!key) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (PyDict_SetItem(psyco_adapters, key, cast) != 0) {
|
||||
Py_DECREF(key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Py_DECREF(key);
|
||||
|
||||
return 0;
|
||||
|
@ -85,6 +92,9 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
|
|||
|
||||
/* look for an adapter in the registry */
|
||||
key = Py_BuildValue("(OO)", (PyObject*)obj->ob_type, proto);
|
||||
if (!key) {
|
||||
return NULL;
|
||||
}
|
||||
adapter = PyDict_GetItem(psyco_adapters, key);
|
||||
Py_DECREF(key);
|
||||
if (adapter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue