mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)
Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail if the method was already untracked.
This commit is contained in:
parent
474f296718
commit
662dd29456
1 changed files with 1 additions and 1 deletions
|
@ -244,7 +244,7 @@ static void
|
||||||
method_dealloc(PyObject *self)
|
method_dealloc(PyObject *self)
|
||||||
{
|
{
|
||||||
PyMethodObject *im = _PyMethodObject_CAST(self);
|
PyMethodObject *im = _PyMethodObject_CAST(self);
|
||||||
_PyObject_GC_UNTRACK(im);
|
PyObject_GC_UnTrack(im);
|
||||||
if (im->im_weakreflist != NULL)
|
if (im->im_weakreflist != NULL)
|
||||||
PyObject_ClearWeakRefs((PyObject *)im);
|
PyObject_ClearWeakRefs((PyObject *)im);
|
||||||
Py_DECREF(im->im_func);
|
Py_DECREF(im->im_func);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue