summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 5cf508fc7..d2f6066cb 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1528,14 +1528,16 @@ ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
static PyObject *
FunctionGetattro(PyObject *self, PyObject *nameobj)
{
+ PyObject *r;
FunctionObject *this = (FunctionObject *)(self);
GET_ATTR_STRING(name, nameobj);
- if (strcmp(name, "name") == 0)
- return PyUnicode_FromString((char *)(this->name));
-
- return PyObject_GenericGetAttr(self, nameobj);
+ r = FunctionAttr(this, name);
+ if (r || PyErr_Occurred())
+ return r;
+ else
+ return PyObject_GenericGetAttr(self, nameobj);
}
/* External interface