mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)
This commit is contained in:
parent
3ccef1ca47
commit
bf64d9064a
7 changed files with 45 additions and 82 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue