[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.132,2.133

Guido van Rossum gvanrossum@users.sourceforge.net
2002年4月02日 09:53:49 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv21076/Objects
Modified Files:
	typeobject.c 
Log Message:
SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods.
Bugfix candidate.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.132
retrieving revision 2.133
diff -C2 -d -r2.132 -r2.133
*** typeobject.c	31 Mar 2002 16:06:11 -0000	2.132
--- typeobject.c	2 Apr 2002 17:53:47 -0000	2.133
***************
*** 4022,4029 ****
 	if (su->obj != NULL) {
 		PyObject *mro, *res, *tmp, *dict;
 		descrgetfunc f;
 		int i, n;
 
! 		mro = su->obj->ob_type->tp_mro;
 		if (mro == NULL)
 			n = 0;
--- 4022,4032 ----
 	if (su->obj != NULL) {
 		PyObject *mro, *res, *tmp, *dict;
+ 		PyTypeObject *starttype;
 		descrgetfunc f;
 		int i, n;
 
! 		starttype = su->obj->ob_type;
! 		mro = starttype->tp_mro;
! 
 		if (mro == NULL)
 			n = 0;
***************
*** 4037,4041 ****
 		}
 		if (i >= n && PyType_Check(su->obj)) {
! 			mro = ((PyTypeObject *)(su->obj))->tp_mro;
 			if (mro == NULL)
 				n = 0;
--- 4040,4045 ----
 		}
 		if (i >= n && PyType_Check(su->obj)) {
! 			starttype = (PyTypeObject *)(su->obj);
! 			mro = starttype->tp_mro;
 			if (mro == NULL)
 				n = 0;
***************
*** 4065,4069 ****
 				f = res->ob_type->tp_descr_get;
 				if (f != NULL) {
! 					tmp = f(res, su->obj, res);
 					Py_DECREF(res);
 					res = tmp;
--- 4069,4073 ----
 				f = res->ob_type->tp_descr_get;
 				if (f != NULL) {
! 					tmp = f(res, su->obj, (PyObject *)starttype);
 					Py_DECREF(res);
 					res = tmp;

AltStyle によって変換されたページ (->オリジナル) /