diff Modules/_sqlite/microprotocols.c @ 72835:5e33219492bc

Add API for static strings, primarily good for identifiers. Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
author Martin v. Löwis <martin@v.loewis.de>
date Sun, 09 Oct 2011 10:38:36 +0200
parents 8f886acaa142
children 7109f31300fb
line wrap: on
line diff
--- a/Modules/_sqlite/microprotocols.c	Sun Oct 09 08:58:16 2011 +0200
+++ b/Modules/_sqlite/microprotocols.c	Sun Oct 09 10:38:36 2011 +0200
@@ -95,7 +95,9 @@
 
     /* 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 @@
 
     /* 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;