summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/microprotocols.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2020-12-27 11:05:33 (GMT)
committerGitHub <noreply@github.com>2020-12-27 11:05:33 (GMT)
commitbf64d9064ab641b1ef9a0c4bda097ebf1204faf4 (patch)
tree087d470d6d608bedff06e712fa7b85ffb59a4359 /Modules/_sqlite/microprotocols.c
parent3ccef1ca474592e191a00e131dfbaf777db271e9 (diff)
downloadcpython-bf64d9064ab641b1ef9a0c4bda097ebf1204faf4.zip
cpython-bf64d9064ab641b1ef9a0c4bda097ebf1204faf4.tar.gz
cpython-bf64d9064ab641b1ef9a0c4bda097ebf1204faf4.tar.bz2
bpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)
Diffstat (limited to 'Modules/_sqlite/microprotocols.c')
-rw-r--r--Modules/_sqlite/microprotocols.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c
index 41f0867..e219a72 100644
--- a/Modules/_sqlite/microprotocols.c
+++ b/Modules/_sqlite/microprotocols.c
@@ -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");