summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorJason Fried <me@jasonfried.info>2024-09-24 03:40:17 (GMT)
committerGitHub <noreply@github.com>2024-09-24 03:40:17 (GMT)
commitd87482bc4ee9458d6ba16140e7bc008637dbbb16 (patch)
tree73f8b75435b42383b5960fcfa0d78068dd6e55da /Python/pystate.c
parentad7c7785461fffba04f5a36cd6d062e92b0fda16 (diff)
downloadcpython-d87482bc4ee9458d6ba16140e7bc008637dbbb16.zip
cpython-d87482bc4ee9458d6ba16140e7bc008637dbbb16.tar.gz
cpython-d87482bc4ee9458d6ba16140e7bc008637dbbb16.tar.bz2
gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 54caf37..6bf7ebe 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -906,6 +906,11 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
interp->code_watchers[i] = NULL;
}
interp->active_code_watchers = 0;
+
+ for (int i=0; i < CONTEXT_MAX_WATCHERS; i++) {
+ interp->context_watchers[i] = NULL;
+ }
+ interp->active_context_watchers = 0;
// XXX Once we have one allocator per interpreter (i.e.
// per-interpreter GC) we must ensure that all of the interpreter's
// objects have been cleaned up at the point.