[Python-checkins] python/dist/src/Python future.c,2.14,2.15

jhylton at users.sourceforge.net jhylton at users.sourceforge.net
Fri Feb 4 19:38:47 CET 2005


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

Modified Files:
	future.c 
Log Message:
Fix bug that allowed future statements virtually anywhere in a module.

If we exit via the break here, we need to set ff_last_lineno or
FUTURE_POSSIBLE() will remain true.  The bug affected statements
containing a variety of expressions, but not all expressions.  It has
been present since Python 2.2.


Index: future.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/future.c,v
retrieving revision 2.14
retrieving revision 2.15
diff -u -d -r2.14 -r2.15
--- future.c	31 Aug 2004 10:07:13 -0000	2.14
+++ future.c	4 Feb 2005 18:38:43 -0000	2.15
@@ -93,7 +93,6 @@
 {
 	int i, r;
  loop:
-
 	switch (TYPE(n)) {
 
 	case single_input:
@@ -222,6 +221,7 @@
 			n = CHILD(n, 0);
 			goto loop;
 		}
+                ff->ff_last_lineno = n->n_lineno;
 		break;
 
 	case atom:
@@ -258,4 +258,3 @@
 	}
 	return ff;
 }
-



More information about the Python-checkins mailing list