diff options
author | Richard Hansen <rhansen@rhansen.org> | 2024-10-12 20:57:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-12 20:57:27 (GMT) |
commit | 330c527299a5380f39c658bfa9321706cabc445d (patch) | |
tree | 1775de190a8bf9674f0131504aac0981b430b7d9 /Python/context.c | |
parent | fa52b82c91a8e1a0971bd5fef656473ec93f41e3 (diff) | |
download | cpython-330c527299a5380f39c658bfa9321706cabc445d.zip cpython-330c527299a5380f39c658bfa9321706cabc445d.tar.gz cpython-330c527299a5380f39c658bfa9321706cabc445d.tar.bz2 |
gh-124872: Change PyContext_WatchCallback to take PyObject (#124737)
The PyContext struct is not intended to be public, and users of the
API don't need anything more specific than PyObject. Also see
gh-78943.
Diffstat (limited to 'Python/context.c')
-rw-r--r-- | Python/context.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/context.c b/Python/context.c index 9b74213..8bc487a 100644 --- a/Python/context.c +++ b/Python/context.c @@ -113,7 +113,7 @@ context_event_name(PyContextEvent event) { } static void -notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyContext *ctx) +notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyObject *ctx) { assert(Py_REFCNT(ctx) > 0); PyInterpreterState *interp = ts->interp; @@ -193,7 +193,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx) ts->context = Py_NewRef(ctx); ts->context_ver++; - notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, ctx); + notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, octx); return 0; } @@ -227,7 +227,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx) return -1; } - notify_context_watchers(ts, Py_CONTEXT_EVENT_EXIT, ctx); + notify_context_watchers(ts, Py_CONTEXT_EVENT_EXIT, octx); Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev); ts->context_ver++; |