Skip to content

Commit bd32479

Browse files
author
jhylton
committed
Need to support single_input explicitly so from __future__ imports
are legal at the interactive interpreter prompt. They don't do anything yet... git-svn-id: http://svn.python.org/projects/python/trunk@19699 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 48c3f9b commit bd32479

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Python/future.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ future_parse(PyFutureFeatures *ff, node *n, char *filename)
7171

7272
switch (TYPE(n)) {
7373

74+
case single_input:
75+
if (TYPE(CHILD(n, 0)) == simple_stmt) {
76+
n = CHILD(n, 0);
77+
goto loop;
78+
}
79+
return 0;
80+
7481
case file_input:
7582
for (i = 0; i < NCH(n); i++) {
7683
node *ch = CHILD(n, i);
@@ -157,6 +164,7 @@ future_parse(PyFutureFeatures *ff, node *n, char *filename)
157164
return 0;
158165
if (future_check_features(ff, n) < 0)
159166
return -1;
167+
ff->ff_last_lineno = n->n_lineno + 1;
160168
return 1;
161169
}
162170

0 commit comments

Comments
 (0)