diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-28 02:26:14 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-28 02:26:14 +0000 |
commit | c51911cbc2cfd22c552cf634111ad2d16233ddc4 (patch) | |
tree | be4b22a47e5605fde9bf28986b939de2f1c779ec /Python/future.c | |
parent | 18c95f725ceeb660137ff03b7786e196afc83ef4 (diff) | |
download | cpython-c51911cbc2cfd22c552cf634111ad2d16233ddc4.tar.gz |
Need to support single_input explicitly so from __future__ imports
are legal at the interactive interpreter prompt. They don't do
anything yet...
Diffstat (limited to 'Python/future.c')
-rw-r--r-- | Python/future.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/future.c b/Python/future.c index 18bae1f9b9..37d5476219 100644 --- a/Python/future.c +++ b/Python/future.c @@ -71,6 +71,13 @@ future_parse(PyFutureFeatures *ff, node *n, char *filename) switch (TYPE(n)) { + case single_input: + if (TYPE(CHILD(n, 0)) == simple_stmt) { + n = CHILD(n, 0); + goto loop; + } + return 0; + case file_input: for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); @@ -157,6 +164,7 @@ future_parse(PyFutureFeatures *ff, node *n, char *filename) return 0; if (future_check_features(ff, n) < 0) return -1; + ff->ff_last_lineno = n->n_lineno + 1; return 1; } |