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

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 05 Jul 2001 14:26:02 -0700


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

Modified Files:
      Tag: descr-branch
	typeobject.c 
Log Message:
test_getattro(): fix a subtle bug.  When a method was found in the
metatype, its binding operation was invoked with NULL instead of the
type object, so it would be returned as an unbound method!

This confused the heck out of me while trying to add mro() as a method
defined in the metatype.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.16.8.60
retrieving revision 2.16.8.61
diff -C2 -r2.16.8.60 -r2.16.8.61
*** typeobject.c	2001/07/04 00:13:58	2.16.8.60
--- typeobject.c	2001/07/05 21:26:00	2.16.8.61
***************
*** 664,668 ****
  	/* Use the descriptor from the metatype */
  	if (f != NULL) {
! 		res = f(descr, (PyObject *)NULL, (PyObject *)metatype);
  		return res;
  	}
--- 664,668 ----
  	/* Use the descriptor from the metatype */
  	if (f != NULL) {
! 		res = f(descr, (PyObject *)type, (PyObject *)metatype);
  		return res;
  	}