[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.60,2.16.8.61
Guido van Rossum
gvanrossum@users.sourceforge.net
2001年7月05日 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;
}