summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/module.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/module.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/module.c')
-rw-r--r--Modules/_sqlite/module.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 372f3dd..cd2eb57 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -120,17 +120,11 @@ static PyObject *
pysqlite_complete_statement_impl(PyObject *module, const char *statement)
/*[clinic end generated code: output=e55f1ff1952df558 input=f6b24996b31c5c33]*/
{
- PyObject* result;
-
if (sqlite3_complete(statement)) {
- result = Py_True;
+ return Py_NewRef(Py_True);
} else {
- result = Py_False;
+ return Py_NewRef(Py_False);
}
-
- Py_INCREF(result);
-
- return result;
}
/*[clinic input]
@@ -219,8 +213,7 @@ pysqlite_register_converter_impl(PyObject *module, PyObject *orig_name,
goto error;
}
- Py_INCREF(Py_None);
- retval = Py_None;
+ retval = Py_NewRef(Py_None);
error:
Py_XDECREF(name);
return retval;