mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)
This commit is contained in:
parent
d64f3caebe
commit
b2077117d1
5 changed files with 61 additions and 39 deletions
|
@ -23,8 +23,6 @@
|
|||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define NEEDS_PY_IDENTIFIER
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "cursor.h"
|
||||
|
@ -76,8 +74,6 @@ PyObject *
|
|||
pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
|
||||
PyObject *proto, PyObject *alt)
|
||||
{
|
||||
_Py_IDENTIFIER(__adapt__);
|
||||
_Py_IDENTIFIER(__conform__);
|
||||
PyObject *adapter, *key, *adapted;
|
||||
|
||||
/* we don't check for exact type conformance as specified in PEP 246
|
||||
|
@ -102,7 +98,7 @@ pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
|
|||
}
|
||||
|
||||
/* try to have the protocol adapt this object */
|
||||
if (_PyObject_LookupAttrId(proto, &PyId___adapt__, &adapter) < 0) {
|
||||
if (_PyObject_LookupAttr(proto, state->str___adapt__, &adapter) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (adapter) {
|
||||
|
@ -121,7 +117,7 @@ pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
|
|||
}
|
||||
|
||||
/* and finally try to have the object adapt itself */
|
||||
if (_PyObject_LookupAttrId(obj, &PyId___conform__, &adapter) < 0) {
|
||||
if (_PyObject_LookupAttr(obj, state->str___conform__, &adapter) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (adapter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue