1. Armin Rigo
  2. cpython-withatomic

Commits

Michael W. Hudson  committed d702967

backport gvanrossum's checkin of
revision 2.133 of typeobject.c

SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods.

Bugfix candidate.

  • Participants
  • Parent commits 216dad7
  • Branches 2.2

Comments (0)

Files changed (1)

File Objects/typeobject.c

View file
 
 	if (su->obj != NULL) {
 		PyObject *mro, *res, *tmp, *dict;
+		PyTypeObject *starttype;
 		descrgetfunc f;
 		int i, n;
 
-		mro = su->obj->ob_type->tp_mro;
+		starttype = su->obj->ob_type;
+		mro = starttype->tp_mro;
+
 		if (mro == NULL)
 			n = 0;
 		else {
 				break;
 		}
 		if (i >= n && PyType_Check(su->obj)) {
-			mro = ((PyTypeObject *)(su->obj))->tp_mro;
+			starttype = (PyTypeObject *)(su->obj);
+			mro = starttype->tp_mro;
 			if (mro == NULL)
 				n = 0;
 			else {
 				Py_INCREF(res);
 				f = res->ob_type->tp_descr_get;
 				if (f != NULL) {
-					tmp = f(res, su->obj, res);
+					tmp = f(res, su->obj, (PyObject *)starttype);
 					Py_DECREF(res);
 					res = tmp;
 				}