[Python-checkins] python/dist/src/Objects codeobject.c, 1.1.2.2, 1.1.2.3

bcannon@users.sourceforge.net bcannon at users.sourceforge.net
Mon Jul 11 05:37:14 CEST 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv480/Objects

Modified Files:
      Tag: ast-branch
	codeobject.c 
Log Message:
When comparing code objects, also take into account which line they start on.
This fixes bug #1190011 where code objects were comparing equal.  Fixed with
code from HEAD that fixed the same problem.
Thanks Nick Coghlan for pulling the code from mwh's fix.


Index: codeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/Attic/codeobject.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- codeobject.c	23 Aug 2002 18:20:24 -0000	1.1.2.2
+++ codeobject.c	11 Jul 2005 03:37:11 -0000	1.1.2.3
@@ -239,6 +239,8 @@
 	if (cmp) return cmp;
 	cmp = co->co_flags - cp->co_flags;
 	if (cmp) return cmp;
+	cmp = co->co_firstlineno - cp->co_firstlineno;
+	if (cmp) return cmp;
 	cmp = PyObject_Compare(co->co_code, cp->co_code);
 	if (cmp) return cmp;
 	cmp = PyObject_Compare(co->co_consts, cp->co_consts);



More information about the Python-checkins mailing list