1 parent 7a6bbeb commit 1f4e927Copy full SHA for 1f4e927
1 file changed
Objects/classobject.c
@@ -218,14 +218,15 @@ method_repr(PyMethodObject *a)
218
{
219
PyObject *self = a->im_self;
220
PyObject *func = a->im_func;
221
- PyObject *klass = (PyObject*)Py_TYPE(self);
+ PyObject *klass;
222
PyObject *funcname = NULL ,*klassname = NULL, *result = NULL;
223
char *defname = "?";
224
225
if (self == NULL) {
226
PyErr_BadInternalCall();
227
return NULL;
228
}
229
+ klass = (PyObject*)Py_TYPE(self);
230
231
funcname = PyObject_GetAttrString(func, "__name__");
232
if (funcname == NULL) {
0 commit comments