From: Christian Heimes Date: Mon, 10 Sep 2012 00:45:56 +0000 (+0200) Subject: Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after... X-Git-Tag: v3.3.1rc1~818^2^2~114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f03572d040f0f34b7fd3c1bcbd232d60b5a00d78;p=python Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL --- f03572d040f0f34b7fd3c1bcbd232d60b5a00d78 diff --cc Objects/classobject.c index c481dd3e9c,f9568527b3..cdc9b1c647 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@@ -227,8 -226,9 +227,9 @@@ method_repr(PyMethodObject *a PyErr_BadInternalCall(); return NULL; } + klass = (PyObject*)Py_TYPE(self); - funcname = PyObject_GetAttrString(func, "__name__"); + funcname = _PyObject_GetAttrId(func, &PyId___name__); if (funcname == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL;