Merged revisions 72461 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72461 | benjamin.peterson | 2009-05-07 22:06:00 -0500 (Thu, 07 May 2009) | 1 line

  add _PyObject_LookupSpecial to handle fetching special method lookup
........
This commit is contained in:
Benjamin Peterson 2009-05-08 03:25:19 +00:00
parent c04dad772c
commit 224205fde2
4 changed files with 63 additions and 9 deletions

View file

@ -1125,6 +1125,8 @@ PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
when the _PyType_Lookup() call fails;
- lookup_method() always raises an exception upon errors.
- _PyObject_LookupSpecial() exported for the benefit of other places.
*/
static PyObject *
@ -1157,6 +1159,12 @@ lookup_method(PyObject *self, char *attrstr, PyObject **attrobj)
return res;
}
PyObject *
_PyObject_LookupSpecial(PyObject *self, char *attrstr, PyObject **attrobj)
{
return lookup_maybe(self, attrstr, attrobj);
}
/* A variation of PyObject_CallMethod that uses lookup_method()
instead of PyObject_GetAttrString(). This uses the same convention
as lookup_method to cache the interned name string object. */