mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464)
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function.
This commit is contained in:
parent
d1124b09e8
commit
142e5c5445
2 changed files with 9 additions and 2 deletions
|
@ -6548,6 +6548,13 @@ heapctype_init(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
heapgcctype_traverse(HeapCTypeObject *self, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(Py_TYPE(self));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
heapgcctype_dealloc(HeapCTypeObject *self)
|
||||
{
|
||||
|
@ -6561,6 +6568,7 @@ static PyType_Slot HeapGcCType_slots[] = {
|
|||
{Py_tp_init, heapctype_init},
|
||||
{Py_tp_members, heapctype_members},
|
||||
{Py_tp_dealloc, heapgcctype_dealloc},
|
||||
{Py_tp_traverse, heapgcctype_traverse},
|
||||
{Py_tp_doc, (char*)heapgctype__doc__},
|
||||
{0, 0},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue