mirror of
https://github.com/python/cpython.git
synced 2025-10-27 19:54:38 +00:00
gh-138342: Use a common utility for visiting an object's type (GH-138343)
Add `_PyObject_VisitType` in place of `tp_traverse` functions that only visit the object's type.
This commit is contained in:
parent
0d02e4d7d3
commit
4f6ecd10c2
24 changed files with 41 additions and 203 deletions
|
|
@ -5538,13 +5538,6 @@ sock_finalize(PyObject *self)
|
|||
PyErr_SetRaisedException(exc);
|
||||
}
|
||||
|
||||
static int
|
||||
sock_traverse(PyObject *s, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(Py_TYPE(s));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
sock_dealloc(PyObject *s)
|
||||
{
|
||||
|
|
@ -5843,7 +5836,7 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
|
|||
|
||||
static PyType_Slot sock_slots[] = {
|
||||
{Py_tp_dealloc, sock_dealloc},
|
||||
{Py_tp_traverse, sock_traverse},
|
||||
{Py_tp_traverse, _PyObject_VisitType},
|
||||
{Py_tp_repr, sock_repr},
|
||||
{Py_tp_doc, (void *)sock_doc},
|
||||
{Py_tp_methods, sock_methods},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue