diff options
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index b7d35ef8852..f9568527b36 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -218,7 +218,7 @@ method_repr(PyMethodObject *a) { PyObject *self = a->im_self; PyObject *func = a->im_func; - PyObject *klass = (PyObject*)Py_TYPE(self); + PyObject *klass; PyObject *funcname = NULL ,*klassname = NULL, *result = NULL; char *defname = "?"; @@ -226,6 +226,7 @@ method_repr(PyMethodObject *a) PyErr_BadInternalCall(); return NULL; } + klass = (PyObject*)Py_TYPE(self); funcname = PyObject_GetAttrString(func, "__name__"); if (funcname == NULL) { |