diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 5db86a6721b..6cbf297c586 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -965,10 +965,8 @@ sm_traverse(staticmethod *sm, visitproc visit, void *arg) static int sm_clear(staticmethod *sm) { - Py_XDECREF(sm->sm_callable); - sm->sm_callable = NULL; + Py_CLEAR(sm->sm_callable); Py_CLEAR(sm->sm_dict); - return 0; }