summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-13 18:03:57 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-10-13 18:03:57 (GMT)
commitbfc6d74b257277d61395ed077e10a6fb9cfb583e (patch)
tree3d21c21dca7134b2281a684eecfbd6c480ad85e4 /Objects
parentf0b934b01a88cd86138d73878538d2471d34f2de (diff)
downloadcpython-bfc6d74b257277d61395ed077e10a6fb9cfb583e.zip
cpython-bfc6d74b257277d61395ed077e10a6fb9cfb583e.tar.gz
cpython-bfc6d74b257277d61395ed077e10a6fb9cfb583e.tar.bz2
Use GetAttrId directly. Proposed by Amaury.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 526ad4c..61f5bb1 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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))