Commit bfc6d74b authored by Martin v. Löwis's avatar Martin v. Löwis

Use GetAttrId directly. Proposed by Amaury.

parent f0b934b0
...@@ -6308,16 +6308,9 @@ supercheck(PyTypeObject *type, PyObject *obj) ...@@ -6308,16 +6308,9 @@ supercheck(PyTypeObject *type, PyObject *obj)
} }
else { else {
/* Try the slow way */ /* Try the slow way */
PyObject *class_str = NULL;
PyObject *class_attr; PyObject *class_attr;
class_str = _PyUnicode_FromId(&PyId___class__); class_attr = _PyObject_GetAttrId(obj, &PyId___class__);
if (class_str == NULL)
return NULL;
class_attr = PyObject_GetAttr(obj, class_str);
Py_DECREF(class_str);
if (class_attr != NULL && if (class_attr != NULL &&
PyType_Check(class_attr) && PyType_Check(class_attr) &&
(PyTypeObject *)class_attr != Py_TYPE(obj)) (PyTypeObject *)class_attr != Py_TYPE(obj))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment