summaryrefslogtreecommitdiff
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-04-13 21:27:19 -0400
committerR David Murray <rdmurray@bitdance.com>2012-04-13 21:27:19 -0400
commitea7bc055b08fb442986e0735b1b5b325b0b51ecc (patch)
tree20c2b837c787daf7e95ece075e6544627b17625a /Objects/classobject.c
parentc32365d2ce552d1d17279e30a564509235ffb1db (diff)
parentc2c9c905706160bf34aea12f2348210aac3e0da2 (diff)
downloadcpython-ea7bc055b08fb442986e0735b1b5b325b0b51ecc.tar.gz
Merge #14399: corrected news item
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 6df930fdcf..09b95bf29f 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)
{
@@ -190,8 +192,7 @@ method_richcompare(PyObject *self, PyObject *other, int op)
!PyMethod_Check(self) ||
!PyMethod_Check(other))
{
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_RETURN_NOTIMPLEMENTED;
}
a = (PyMethodObject *)self;
b = (PyMethodObject *)other;
@@ -227,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;
@@ -241,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;
@@ -516,8 +517,7 @@ instancemethod_richcompare(PyObject *self, PyObject *other, int op)
!PyInstanceMethod_Check(self) ||
!PyInstanceMethod_Check(other))
{
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_RETURN_NOTIMPLEMENTED;
}
a = (PyInstanceMethodObject *)self;
b = (PyInstanceMethodObject *)other;
@@ -544,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;