Skip to content

Commit 55c530c

Browse files
committed
Use it in _thread.
1 parent b9751b3 commit 55c530c

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

Modules/_threadmodule.c

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,6 @@ PyThreadHandleObject_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
655655
return (PyObject *)PyThreadHandleObject_new(type);
656656
}
657657

658-
static int
659-
PyThreadHandleObject_traverse(PyObject *self, visitproc visit, void *arg)
660-
{
661-
Py_VISIT(Py_TYPE(self));
662-
return 0;
663-
}
664-
665658
static void
666659
PyThreadHandleObject_dealloc(PyObject *op)
667660
{
@@ -751,7 +744,7 @@ static PyType_Slot ThreadHandle_Type_slots[] = {
751744
{Py_tp_dealloc, PyThreadHandleObject_dealloc},
752745
{Py_tp_repr, PyThreadHandleObject_repr},
753746
{Py_tp_getset, ThreadHandle_getsetlist},
754-
{Py_tp_traverse, PyThreadHandleObject_traverse},
747+
{Py_tp_traverse, _PyObject_VisitType},
755748
{Py_tp_methods, ThreadHandle_methods},
756749
{Py_tp_new, PyThreadHandleObject_tp_new},
757750
{0, 0}
@@ -767,13 +760,6 @@ static PyType_Spec ThreadHandle_Type_spec = {
767760

768761
/* Lock objects */
769762

770-
static int
771-
lock_traverse(PyObject *self, visitproc visit, void *arg)
772-
{
773-
Py_VISIT(Py_TYPE(self));
774-
return 0;
775-
}
776-
777763
static void
778764
lock_dealloc(PyObject *self)
779765
{
@@ -1045,7 +1031,7 @@ static PyType_Slot lock_type_slots[] = {
10451031
{Py_tp_repr, lock_repr},
10461032
{Py_tp_doc, (void *)lock_doc},
10471033
{Py_tp_methods, lock_methods},
1048-
{Py_tp_traverse, lock_traverse},
1034+
{Py_tp_traverse, _PyObject_VisitType},
10491035
{Py_tp_new, lock_new},
10501036
{0, 0}
10511037
};
@@ -1060,13 +1046,6 @@ static PyType_Spec lock_type_spec = {
10601046

10611047
/* Recursive lock objects */
10621048

1063-
static int
1064-
rlock_traverse(PyObject *self, visitproc visit, void *arg)
1065-
{
1066-
Py_VISIT(Py_TYPE(self));
1067-
return 0;
1068-
}
1069-
10701049
static int
10711050
rlock_locked_impl(rlockobject *self)
10721051
{
@@ -1359,7 +1338,7 @@ static PyType_Slot rlock_type_slots[] = {
13591338
{Py_tp_methods, rlock_methods},
13601339
{Py_tp_alloc, PyType_GenericAlloc},
13611340
{Py_tp_new, rlock_new},
1362-
{Py_tp_traverse, rlock_traverse},
1341+
{Py_tp_traverse, _PyObject_VisitType},
13631342
{0, 0},
13641343
};
13651344

0 commit comments

Comments
 (0)