Skip to content

Commit 0cb7f4c

Browse files
committed
Use it in socket and unicodedata.
1 parent d8ea9e0 commit 0cb7f4c

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

Modules/socketmodule.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5538,13 +5538,6 @@ sock_finalize(PyObject *self)
55385538
PyErr_SetRaisedException(exc);
55395539
}
55405540

5541-
static int
5542-
sock_traverse(PyObject *s, visitproc visit, void *arg)
5543-
{
5544-
Py_VISIT(Py_TYPE(s));
5545-
return 0;
5546-
}
5547-
55485541
static void
55495542
sock_dealloc(PyObject *s)
55505543
{
@@ -5843,7 +5836,7 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
58435836

58445837
static PyType_Slot sock_slots[] = {
58455838
{Py_tp_dealloc, sock_dealloc},
5846-
{Py_tp_traverse, sock_traverse},
5839+
{Py_tp_traverse, _PyObject_VisitType},
58475840
{Py_tp_repr, sock_repr},
58485841
{Py_tp_doc, (void *)sock_doc},
58495842
{Py_tp_methods, sock_methods},

Modules/unicodedata.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,13 +1594,6 @@ static PyMethodDef unicodedata_functions[] = {
15941594
{NULL, NULL} /* sentinel */
15951595
};
15961596

1597-
static int
1598-
ucd_traverse(PyObject *self, visitproc visit, void *arg)
1599-
{
1600-
Py_VISIT(Py_TYPE(self));
1601-
return 0;
1602-
}
1603-
16041597
static void
16051598
ucd_dealloc(PyObject *self)
16061599
{
@@ -1612,7 +1605,7 @@ ucd_dealloc(PyObject *self)
16121605

16131606
static PyType_Slot ucd_type_slots[] = {
16141607
{Py_tp_dealloc, ucd_dealloc},
1615-
{Py_tp_traverse, ucd_traverse},
1608+
{Py_tp_traverse, _PyObject_VisitType},
16161609
{Py_tp_getattro, PyObject_GenericGetAttr},
16171610
{Py_tp_methods, unicodedata_functions},
16181611
{Py_tp_members, DB_members},

0 commit comments

Comments
 (0)