diff Python/future.c @ 34539:8259ff3ee493 legacy-trunk

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.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Fri, 04 Feb 2005 18:38:43 +0000
parents f7474d31ba3f
children 1c4d192f1568
line wrap: on
line diff
--- a/Python/future.c	Fri Feb 04 14:15:34 2005 +0000
+++ b/Python/future.c	Fri Feb 04 18:38:43 2005 +0000
@@ -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;
 }
-