diff options
Diffstat (limited to 'Modules/_sqlite/microprotocols.c')
-rw-r--r-- | Modules/_sqlite/microprotocols.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c index c730afa..2261b80 100644 --- a/Modules/_sqlite/microprotocols.c +++ b/Modules/_sqlite/microprotocols.c @@ -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; |