summaryrefslogtreecommitdiff
path: root/Modules/_sqlite/microprotocols.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>2022-06-15 10:42:49 +0200
committerGitHub <noreply@github.com>2022-06-15 10:42:49 +0200
commit4e9fa71d7e8e2f322f0b81b315ddc921f57384c0 (patch)
tree3fbc3aad44e36972ba2995b5b15421dd20d65da0 /Modules/_sqlite/microprotocols.c
parentcdd39843073fc27b8e4a887d5d3b7992cb2ced60 (diff)
downloadcpython-git-4e9fa71d7e8e2f322f0b81b315ddc921f57384c0.tar.gz
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/microprotocols.c')
-rw-r--r--Modules/_sqlite/microprotocols.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c
index a79f0067b1..148220d0f9 100644
--- a/Modules/_sqlite/microprotocols.c
+++ b/Modules/_sqlite/microprotocols.c
@@ -57,7 +57,7 @@ pysqlite_microprotocols_add(pysqlite_state *state, PyTypeObject *type,
assert(type != NULL);
assert(proto != NULL);
- key = Py_BuildValue("(OO)", (PyObject*)type, proto);
+ key = PyTuple_Pack(2, (PyObject *)type, proto);
if (!key) {
return -1;
}
@@ -81,7 +81,7 @@ pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
way to get a quotable object to be its instance */
/* look for an adapter in the registry */
- key = Py_BuildValue("(OO)", (PyObject*)Py_TYPE(obj), proto);
+ key = PyTuple_Pack(2, (PyObject *)Py_TYPE(obj), proto);
if (!key) {
return NULL;
}