Add API for static strings, primarily good for identifiers.

Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
This commit is contained in:
Martin v. Löwis 2011-10-09 10:38:36 +02:00
parent 67df285a33
commit afe55bba33
50 changed files with 578 additions and 240 deletions

View file

@ -95,7 +95,9 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
/* try to have the protocol adapt this object*/
if (PyObject_HasAttrString(proto, "__adapt__")) {
PyObject *adapted = PyObject_CallMethod(proto, "__adapt__", "O", obj);
_Py_identifier(__adapt__);
PyObject *adapted = _PyObject_CallMethodId(proto, &PyId___adapt__, "O", obj);
if (adapted) {
if (adapted != Py_None) {
return adapted;
@ -110,7 +112,9 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
/* and finally try to have the object adapt itself */
if (PyObject_HasAttrString(obj, "__conform__")) {
PyObject *adapted = PyObject_CallMethod(obj, "__conform__","O", proto);
_Py_identifier(__conform__);
PyObject *adapted = _PyObject_CallMethodId(obj, &PyId___conform__,"O", proto);
if (adapted) {
if (adapted != Py_None) {
return adapted;