mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Backed out changeset 7efddbf1aa70
This commit is contained in:
parent
ebea9988e0
commit
8be1c39eb3
4 changed files with 144 additions and 147 deletions
|
@ -1425,16 +1425,15 @@ _PyObject_LookupSpecial(PyObject *self, _Py_Identifier *attrid)
|
|||
as lookup_method to cache the interned name string object. */
|
||||
|
||||
static PyObject *
|
||||
call_method(PyObject *obj, _Py_Identifier *method, const char *format, ...)
|
||||
call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
|
||||
{
|
||||
va_list va;
|
||||
PyObject *func, *retval;
|
||||
PyObject *func = NULL, *retval;
|
||||
|
||||
func = lookup_maybe(obj, method);
|
||||
func = lookup_maybe(o, nameid);
|
||||
if (func == NULL) {
|
||||
if (!PyErr_Occurred()) {
|
||||
PyErr_SetObject(PyExc_AttributeError, method->object);
|
||||
}
|
||||
if (!PyErr_Occurred())
|
||||
PyErr_SetObject(PyExc_AttributeError, nameid->object);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1466,12 +1465,12 @@ call_method(PyObject *obj, _Py_Identifier *method, const char *format, ...)
|
|||
/* Clone of call_method() that returns NotImplemented when the lookup fails. */
|
||||
|
||||
static PyObject *
|
||||
call_maybe(PyObject *obj, _Py_Identifier *method, const char *format, ...)
|
||||
call_maybe(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
|
||||
{
|
||||
va_list va;
|
||||
PyObject *func, *retval;
|
||||
PyObject *func = NULL, *retval;
|
||||
|
||||
func = lookup_maybe(obj, method);
|
||||
func = lookup_maybe(o, nameid);
|
||||
if (func == NULL) {
|
||||
if (!PyErr_Occurred())
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue