]> granicus.if.org Git - python/commitdiff
Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after...
authorChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 00:45:56 +0000 (02:45 +0200)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 00:45:56 +0000 (02:45 +0200)
1  2 
Objects/classobject.c

index c481dd3e9c63a7056e37c583eaf540949b1b513d,f9568527b366b8017537d665275d06090a606500..cdc9b1c6471946f55d9532fbc3100923c460628f
@@@ -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;