summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/connection.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>2022-06-15 08:42:49 (GMT)
committerGitHub <noreply@github.com>2022-06-15 08:42:49 (GMT)
commit4e9fa71d7e8e2f322f0b81b315ddc921f57384c0 (patch)
tree3fbc3aad44e36972ba2995b5b15421dd20d65da0 /Modules/_sqlite/connection.c
parentcdd39843073fc27b8e4a887d5d3b7992cb2ced60 (diff)
downloadcpython-4e9fa71d7e8e2f322f0b81b315ddc921f57384c0.zip
cpython-4e9fa71d7e8e2f322f0b81b315ddc921f57384c0.tar.gz
cpython-4e9fa71d7e8e2f322f0b81b315ddc921f57384c0.tar.bz2
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
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r--Modules/_sqlite/connection.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 484af7a..f0e6a56 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -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)