gh-93829: In sqlite3, replace Py_BuildValue with faster APIs (#93830)

- In Modules/_sqlite/connection.c, use PyLong_FromLong
- In Modules/_sqlite/microprotocols.c, use PyTuple_Pack
This commit is contained in:
Erlend Egeberg Aasland 2022-06-15 10:42:49 +02:00 committed by GitHub
parent cdd3984307
commit 4e9fa71d7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -1582,9 +1582,8 @@ static PyObject* pysqlite_connection_get_total_changes(pysqlite_Connection* self
{
if (!pysqlite_check_connection(self)) {
return NULL;
} else {
return Py_BuildValue("i", sqlite3_total_changes(self->db));
}
return PyLong_FromLong(sqlite3_total_changes(self->db));
}
static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* self, void* unused)