]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Thu, 15 Jul 2021 15:49:14 +0000 (17:49 +0200)
committerGitHub <noreply@github.com>
Thu, 15 Jul 2021 15:49:14 +0000 (16:49 +0100)
Modules/_sqlite/connection.c

index 64bd53aea7ea6ad56bca37cb0d8a9774e16f4627..63b0fb9784a0b59d0bba9f03a9f755e33e43d60c 100644 (file)
@@ -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;
     }