bpo-41861: Convert _sqlite3 PrepareProtocolType to heap type (GH-22428)

This commit is contained in:
Erlend Egeberg Aasland 2020-09-29 00:05:04 +02:00 committed by GitHub
parent d332e7b816
commit cb6db8b6ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 54 deletions

View file

@ -56,7 +56,7 @@ pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
PyObject* key;
int rc;
if (proto == NULL) proto = (PyObject*)&pysqlite_PrepareProtocolType;
if (proto == NULL) proto = (PyObject*)pysqlite_PrepareProtocolType;
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
if (!key) {
@ -152,7 +152,7 @@ PyObject *
pysqlite_adapt(pysqlite_Cursor *self, PyObject *args)
{
PyObject *obj, *alt = NULL;
PyObject *proto = (PyObject*)&pysqlite_PrepareProtocolType;
PyObject *proto = (PyObject*)pysqlite_PrepareProtocolType;
if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL;
return pysqlite_microprotocols_adapt(obj, proto, alt);