summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 10b5c5d..a1b3bc2 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2883,12 +2883,11 @@ call_method(PyObject *func, PyObject *arg, PyObject *kw)
return NULL;
}
if (!ok) {
- PyObject* fn = ((PyFunctionObject*) func)->func_name;
+ char* fn = get_func_name(func);
PyErr_Format(PyExc_TypeError,
"unbound method %s%smust be "
"called with instance as first argument",
- fn ? PyString_AsString(fn) : "",
- fn ? "() " : "");
+ fn ? fn : "", fn ? "() " : "");
return NULL;
}
Py_INCREF(arg);