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

Guido van Rossum gvanrossum@users.sourceforge.net
Wed, 17 Oct 2001 00:15:46 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv16609

Modified Files:
	typeobject.c 
Log Message:
slot_sq_item(): ensure that self is an instance of the wrapper's
d_type before calling the wrapped function.

fixup_slot_dispatchers(): fix indentation.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.106
retrieving revision 2.107
diff -C2 -d -r2.106 -r2.107
*** typeobject.c	2001/10/16 17:00:48	2.106
--- typeobject.c	2001/10/17 07:15:43	2.107
***************
*** 2909,2913 ****
  			PyWrapperDescrObject *wrapper =
  				(PyWrapperDescrObject *)func;
! 			if (wrapper->d_base->wrapper == wrap_sq_item) {
  				intargfunc f;
  				f = (intargfunc)(wrapper->d_wrapped);
--- 2909,2914 ----
  			PyWrapperDescrObject *wrapper =
  				(PyWrapperDescrObject *)func;
! 			if (wrapper->d_base->wrapper == wrap_sq_item &&
! 			    PyType_IsSubtype(self->ob_type, wrapper->d_type)) {
  				intargfunc f;
  				f = (intargfunc)(wrapper->d_wrapped);
***************
*** 3939,3945 ****
  				d = (PyWrapperDescrObject *)descr;
  				if (d->d_base->wrapper == p->wrapper &&
! 					PyType_IsSubtype(type, d->d_type)) {
  					if (specific == NULL ||
! 						specific == d->d_wrapped)
  						specific = d->d_wrapped;
  					else
--- 3940,3947 ----
  				d = (PyWrapperDescrObject *)descr;
  				if (d->d_base->wrapper == p->wrapper &&
! 				    PyType_IsSubtype(type, d->d_type))
! 				{
  					if (specific == NULL ||
! 					    specific == d->d_wrapped)
  						specific = d->d_wrapped;
  					else