From ae83c782155ffe86830c3255e338f366e331ad30 Mon Sep 17 00:00:00 2001 From: Itamar Ostricher Date: Wed, 14 Dec 2022 11:14:16 -0800 Subject: GH-100000: Cleanup and polish various watchers code (GH-99998) * Initialize `type_watchers` array to `NULL`s * Optimize code watchers notification * Optimize func watchers notification --- Modules/_testcapi/watchers.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Modules') diff --git a/Modules/_testcapi/watchers.c b/Modules/_testcapi/watchers.c index 1d91c206f6..2e8fe1dbf7 100644 --- a/Modules/_testcapi/watchers.c +++ b/Modules/_testcapi/watchers.c @@ -630,14 +630,16 @@ static PyMethodDef test_methods[] = { {"clear_dict_watcher", clear_dict_watcher, METH_O, NULL}, {"watch_dict", watch_dict, METH_VARARGS, NULL}, {"unwatch_dict", unwatch_dict, METH_VARARGS, NULL}, - {"get_dict_watcher_events", get_dict_watcher_events, METH_NOARGS, NULL}, + {"get_dict_watcher_events", + (PyCFunction) get_dict_watcher_events, METH_NOARGS, NULL}, // Type watchers. {"add_type_watcher", add_type_watcher, METH_O, NULL}, {"clear_type_watcher", clear_type_watcher, METH_O, NULL}, {"watch_type", watch_type, METH_VARARGS, NULL}, {"unwatch_type", unwatch_type, METH_VARARGS, NULL}, - {"get_type_modified_events", get_type_modified_events, METH_NOARGS, NULL}, + {"get_type_modified_events", + (PyCFunction) get_type_modified_events, METH_NOARGS, NULL}, // Code object watchers. {"add_code_watcher", add_code_watcher, METH_O, NULL}, -- cgit v1.2.1