bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)

This commit is contained in:
Erlend Egeberg Aasland 2022-02-16 16:24:44 +01:00 committed by GitHub
parent d64f3caebe
commit b2077117d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 39 deletions

View file

@ -21,8 +21,6 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
#define NEEDS_PY_IDENTIFIER
#include "cursor.h"
#include "module.h"
#include "util.h"
@ -131,13 +129,12 @@ _pysqlite_get_converter(pysqlite_state *state, const char *keystr,
PyObject *key;
PyObject *upcase_key;
PyObject *retval;
_Py_IDENTIFIER(upper);
key = PyUnicode_FromStringAndSize(keystr, keylen);
if (!key) {
return NULL;
}
upcase_key = _PyObject_CallMethodIdNoArgs(key, &PyId_upper);
upcase_key = PyObject_CallMethodNoArgs(key, state->str_upper);
Py_DECREF(key);
if (!upcase_key) {
return NULL;
@ -457,7 +454,7 @@ get_statement_from_cache(pysqlite_Cursor *self, PyObject *operation)
return PyObject_Vectorcall(cache, args + 1, nargsf, NULL);
}
static PyObject *
PyObject *
_pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation, PyObject* second_argument)
{
PyObject* parameters_list = NULL;