[Python-checkins] CVS: python/dist/src/Objects object.c,2.119,2.120

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 22 Feb 2001 14:18:06 -0800


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

Modified Files:
	object.c 
Log Message:
In try_3way_to_rich_compare(), swap the call to default_3way_compare()
and the test for errors, so that an error in the default compare
doesn't go undetected.  This fixes SF Bug #132933 (submitted by
effbot) -- list.sort doesn't detect comparision errors.



Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.119
retrieving revision 2.120
diff -C2 -r2.119 -r2.120
*** object.c	2001/02/01 05:27:45	2.119
--- object.c	2001/02/22 22:18:04	2.120
***************
*** 778,785 ****
  
  	c = try_3way_compare(v, w);
- 	if (c <= -2)
- 		return NULL;
  	if (c >= 2)
  		c = default_3way_compare(v, w);
  	switch (op) {
  	case Py_LT: c = c <  0; break;
--- 778,785 ----
  
  	c = try_3way_compare(v, w);
  	if (c >= 2)
  		c = default_3way_compare(v, w);
+ 	if (c <= -2)
+ 		return NULL;
  	switch (op) {
  	case Py_LT: c = c <  0; break;