8000 bpo-44991: Normalise `sqlite3` callback naming by erlend-aasland · Pull Request #28088 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44991: Normalise sqlite3 callback naming #28088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review: include _destructor
  • Loading branch information
Erlend E. Aasland committed Sep 1, 2021
commit 966f0f46592bf6164d819c1339d89f0a630f03bb
8 changes: 4 additions & 4 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ free_callback_context(callback_context *ctx)
}

static void
_destructor(void *ctx)
destructor_callback(void *ctx)
{
if (ctx != NULL) {
// This function may be called without the GIL held, so we need to
Expand Down Expand Up @@ -858,7 +858,7 @@ pysqlite_connection_create_function_impl(pysqlite_Connection *self,
_pysqlite_func_callback,
NULL,
NULL,
&_destructor); // will decref func
&destructor_callback); // will decref func

if (rc != SQLITE_OK) {
/* Workaround for SQLite bug: no error code or string is available here */
Expand Down Expand Up @@ -899,7 +899,7 @@ pysqlite_connection_create_aggregate_impl(pysqlite_Connection *self,
0,
&_pysqlite_step_callback,
&_pysqlite_final_callback,
&_destructor); // will decref func
&destructor_callback); // will decref func
if (rc != SQLITE_OK) {
/* Workaround for SQLite bug: no error code or string is available here */
PyErr_SetString(self->OperationalError, "Error creating aggregate");
Expand Down Expand Up @@ -1727,7 +1727,7 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
}
rc = sqlite3_create_collation_v2(self->db, name, flags, ctx,
&pysqlite_collation_callback,
&_destructor);
&destructor_callback);
}

if (rc != SQLITE_OK) {
Expand Down
0