diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2005-02-04 18:38:43 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2005-02-04 18:38:43 +0000 |
commit | 296b3f38939b22ebe1ae864d3bbf897dfe1bdcfe (patch) | |
tree | d016167b4d6d9fd6cf0b3bd13e4b219f73d16f23 /Python/future.c | |
parent | 67b71c0f7deb16b061eb6501244cba855258e6bd (diff) | |
download | cpython-296b3f38939b22ebe1ae864d3bbf897dfe1bdcfe.tar.gz |
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.
Diffstat (limited to 'Python/future.c')
-rw-r--r-- | Python/future.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/future.c b/Python/future.c index 20d8dd2909..95d6a5c9a3 100644 --- a/Python/future.c +++ b/Python/future.c @@ -93,7 +93,6 @@ future_parse(PyFutureFeatures *ff, node *n, const char *filename) { int i, r; loop: - switch (TYPE(n)) { case single_input: @@ -222,6 +221,7 @@ future_parse(PyFutureFeatures *ff, node *n, const char *filename) n = CHILD(n, 0); goto loop; } + ff->ff_last_lineno = n->n_lineno; break; case atom: @@ -258,4 +258,3 @@ PyNode_Future(node *n, const char *filename) } return ff; } - |