diff options
| author | mpage <mpage@cs.stanford.edu> | 2022-11-22 04:06:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-22 13:06:44 +0100 |
| commit | 3db0a21f731cec28a89f7495a82ee2670bce75fe (patch) | |
| tree | 4a4cc72b265076d18d9dd4ec22d9e5013425cffc /Python | |
| parent | 20d9749a0f9b9fa6946019f04a54b6287d16588e (diff) | |
| download | cpython-git-3db0a21f731cec28a89f7495a82ee2670bce75fe.tar.gz | |
gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175)
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/pystate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index c7f2386f8c..19fd9a6ae4 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. |
