Mercurial > cpython-lru_cache-weakref
diff Modules/_sqlite/microprotocols.c @ 37458:d27058c409df legacy-trunk
Update to pysqlite 2.2.0
| author | Anthony Baxter <anthonybaxter@gmail.com> |
|---|---|
| date | Tue, 04 Apr 2006 06:29:05 +0000 |
| parents | e546274d6503 |
| children | d3969aeba777 |
line wrap: on
line diff
--- a/Modules/_sqlite/microprotocols.c Tue Apr 04 06:03:50 2006 +0000 +++ b/Modules/_sqlite/microprotocols.c Tue Apr 04 06:29:05 2006 +0000 @@ -45,9 +45,7 @@ return -1; } - PyDict_SetItemString(dict, "adapters", psyco_adapters); - - return 0; + return PyDict_SetItemString(dict, "adapters", psyco_adapters); } @@ -65,8 +63,17 @@ 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 @@ /* 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) {
