]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)
authorVictor Stinner <vstinner@python.org>
Thu, 1 May 2025 11:42:42 +0000 (13:42 +0200)
committerGitHub <noreply@github.com>
Thu, 1 May 2025 11:42:42 +0000 (13:42 +0200)
Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail
if the method was already untracked.

Objects/classobject.c

index 58e1d17977322e6e9ed36342aa73e13fc2fa0969..b5df3d1a41b5f9b0e87600e0496191afa2a9a3f4 100644 (file)
@@ -244,7 +244,7 @@ static void
 method_dealloc(PyObject *self)
 {
     PyMethodObject *im = _PyMethodObject_CAST(self);
-    _PyObject_GC_UNTRACK(im);
+    PyObject_GC_UnTrack(im);
     if (im->im_weakreflist != NULL)
         PyObject_ClearWeakRefs((PyObject *)im);
     Py_DECREF(im->im_func);