[Python-checkins] bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158)

pablogsal webhook-mailer at python.org
Thu Jul 15 11:49:29 EDT 2021


https://github.com/python/cpython/commit/5007a4f23c551f8821483d15e76d0d15d5cb9945
commit: 5007a4f23c551f8821483d15e76d0d15d5cb9945
branch: main
author: Erlend Egeberg Aasland <erlend.aasland at innova.no>
committer: pablogsal <Pablogsal at gmail.com>
date: 2021-07-15T16:49:14+01:00
summary:

bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158)

files:
M Modules/_sqlite/connection.c

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 64bd53aea7ea6..63b0fb9784a0b 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1494,9 +1494,9 @@ pysqlite_collation_callback(
         goto finally; /* failed to allocate strings */
     }
 
-    retval = PyObject_CallFunctionObjArgs(callback, string1, string2, NULL);
-
-    if (!retval) {
+    PyObject *args[] = { string1, string2 };  // Borrowed refs.
+    retval = PyObject_Vectorcall(callback, args, 2, NULL);
+    if (retval == NULL) {
         /* execution failed */
         goto finally;
     }



More information about the Python-checkins mailing list