diff --git a/Objects/methodobject.c b/Objects/methodobject.c index cfea8cf410..a063d534cf 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -84,7 +84,8 @@ PyCFunction_GetFlags(PyObject *op) static void meth_dealloc(PyCFunctionObject *m) { - _PyObject_GC_UNTRACK(m); + PyObject_GC_UnTrack(m); + Py_TRASHCAN_SAFE_BEGIN(m) if (m->m_weakreflist != NULL) { PyObject_ClearWeakRefs((PyObject*) m); } @@ -98,6 +99,7 @@ meth_dealloc(PyCFunctionObject *m) else { PyObject_GC_Del(m); } + Py_TRASHCAN_SAFE_END(m) } static PyObject *