Use GetAttrId directly. Proposed by Amaury.

This commit is contained in:
Martin v. Löwis 2011-10-13 20:03:57 +02:00
parent f0b934b01a
commit bfc6d74b25
1 changed files with 1 additions and 8 deletions

View File

@ -6308,16 +6308,9 @@ supercheck(PyTypeObject *type, PyObject *obj)
}
else {
/* Try the slow way */
PyObject *class_str = NULL;
PyObject *class_attr;
class_str = _PyUnicode_FromId(&PyId___class__);
if (class_str == NULL)
return NULL;
class_attr = PyObject_GetAttr(obj, class_str);
Py_DECREF(class_str);
class_attr = _PyObject_GetAttrId(obj, &PyId___class__);
if (class_attr != NULL &&
PyType_Check(class_attr) &&
(PyTypeObject *)class_attr != Py_TYPE(obj))