aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
committerMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
commit1ee1b6fe0dd7baca0da50e365929d03d42128705 (patch)
treeae048787548a8915d3e75054a950f710ed521d84 /Objects/classobject.c
parentany_find_slice() doesn't use callbacks anymore (diff)
downloadcpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.gz
cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.bz2
cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.zip
Use identifier API for PyObject_GetAttrString.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index b52a209e91e..40161ef8188 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -14,6 +14,8 @@ static int numfree = 0;
#define PyMethod_MAXFREELIST 256
#endif
+_Py_identifier(__name__);
+
PyObject *
PyMethod_Function(PyObject *im)
{
@@ -226,7 +228,7 @@ method_repr(PyMethodObject *a)
return NULL;
}
- funcname = PyObject_GetAttrString(func, "__name__");
+ funcname = _PyObject_GetAttrId(func, &PyId___name__);
if (funcname == NULL) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError))
return NULL;
@@ -240,7 +242,7 @@ method_repr(PyMethodObject *a)
if (klass == NULL)
klassname = NULL;
else {
- klassname = PyObject_GetAttrString(klass, "__name__");
+ klassname = _PyObject_GetAttrId(klass, &PyId___name__);
if (klassname == NULL) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError))
return NULL;
@@ -542,7 +544,7 @@ instancemethod_repr(PyObject *self)
return NULL;
}
- funcname = PyObject_GetAttrString(func, "__name__");
+ funcname = _PyObject_GetAttrId(func, &PyId___name__);
if (funcname == NULL) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError))
return NULL;