[Python-checkins] CVS: python/dist/src/Objects object.c,2.136,2.137
Guido van Rossum
gvanrossum@users.sourceforge.net
2001年8月16日 01:02:47 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv29900
Modified Files:
object.c
Log Message:
Update to MvL's patch #424475 to avoid returning 2 when tp_compare
returns that. (This fix is also by MvL; checkin it in because I want
to make more changes here. I'm still not 100% satisfied -- see
comments attached to the patch.)
Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.136
retrieving revision 2.137
diff -C2 -d -r2.136 -r2.137
*** object.c 2001年08月07日 17:24:28 2.136
--- object.c 2001年08月16日 08:02:45 2.137
***************
*** 581,586 ****
if (v->ob_type == w->ob_type
! && (f = v->ob_type->tp_compare) != NULL)
! return (*f)(v, w);
c = try_rich_to_3way_compare(v, w);
if (c < 2)
--- 581,589 ----
if (v->ob_type == w->ob_type
! && (f = v->ob_type->tp_compare) != NULL) {
! c = (*f)(v, w);
! if (c != 2 || !PyInstance_Check(v))
! return c;
! }
c = try_rich_to_3way_compare(v, w);
if (c < 2)