8000 bpo-42064: Pass module state to trace, progress, and authorizer callbacks by erlend-aasland · Pull Request #27940 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42064: Pass module state to trace, progress, and authorizer callbacks #27940

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 17 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
Let set_callback_context live with the other context functions
  • Loading branch information
Erlend E. Aasland committed Sep 7, 2021
commit e0df824aa9c86466a02fa2f6917075d4935fc02b
22 changes: 11 additions & 11 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,6 @@ new_statement_cache(pysqlite_Connection *self, int maxsize)
}


static void
set_callback_context(callback_context **ctx_pp, callback_context *ctx)
{
assert(ctx_pp != NULL);
callback_context *tmp = *ctx_pp;
*ctx_pp = ctx;
if (tmp != NULL) {
free_callback_context(tmp);
}
}

/*[clinic input]
_sqlite3.Connection.__init__ as pysqlite_connection_init

Expand Down Expand Up @@ -846,6 +835,17 @@ free_callback_context(callback_context *ctx)
PyMem_Free(ctx);
}

static void
set_callback_context(callback_context **ctx_pp, callback_context *ctx)
{
assert(ctx_pp != NULL);
callback_context *tmp = *ctx_pp;
*ctx_pp = ctx;
if (tmp != NULL) {
free_callback_context(tmp);
}
}

static void
destructor_callback(void *ctx)
{
Expand Down
0