summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authormpage <mpage@cs.stanford.edu>2022-11-22 12:06:44 (GMT)
committerGitHub <noreply@github.com>2022-11-22 12:06:44 (GMT)
commit3db0a21f731cec28a89f7495a82ee2670bce75fe (patch)
tree4a4cc72b265076d18d9dd4ec22d9e5013425cffc /Python/pystate.c
parent20d9749a0f9b9fa6946019f04a54b6287d16588e (diff)
downloadcpython-3db0a21f731cec28a89f7495a82ee2670bce75fe.zip
cpython-3db0a21f731cec28a89f7495a82ee2670bce75fe.tar.gz
cpython-3db0a21f731cec28a89f7495a82ee2670bce75fe.tar.bz2
gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175)
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 c7f2386..19fd9a6 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -461,6 +461,11 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
interp->dict_state.watchers[i] = NULL;
}
+ for (int i=0; i < FUNC_MAX_WATCHERS; i++) {
+ interp->func_watchers[i] = NULL;
+ }
+ interp->active_func_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.