bpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)

This commit is contained in:
Erlend Egeberg Aasland 2020-12-27 12:05:33 +01:00 committed by GitHub
parent 3ccef1ca47
commit bf64d9064a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 82 deletions

View file

@ -140,8 +140,7 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
}
if (alt) {
Py_INCREF(alt);
return alt;
return Py_NewRef(alt);
}
/* else set the right exception and return NULL */
PyErr_SetString(pysqlite_ProgrammingError, "can't adapt");