Visitar URL original
gh-93955: Use unbound methods for slot `__getattr__` and `__getattribute__` by Fidget-Spinner · Pull Request #93956 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove call_attribute
  • Loading branch information
Fidget-Spinner committed Jun 17, 2022
commit 83809babba2344d18f5a2ba78e3df2bc062be4b9
18 changes: 0 additions & 18 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7782,24 +7782,6 @@ slot_tp_getattro(PyObject *self, PyObject *name)
return vectorcall_method(&_Py_ID(__getattribute__), stack, 2);
}

static PyObject *
call_attribute(PyObject *self, PyObject *attr, PyObject *name)
{
PyObject *res, *descr = NULL;
descrgetfunc f = Py_TYPE(attr)->tp_descr_get;

if (f != NULL) {
descr = f(attr, self, (PyObject *)(Py_TYPE(self)));
if (descr == NULL)
return NULL;
else
attr = descr;
}
res = PyObject_CallOneArg(attr, name);
Py_XDECREF(descr);
return res;
}

static PyObject *
slot_tp_getattr_hook(PyObject *self, PyObject *name)
{
Expand Down