Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 198457a

Browse files
committed
When iterating over the names imported in a future statement, ignore the
commas in the concrete syntax; checking those causes a segfault. This fixes SF bug #407394.
1 parent 0a3939f commit 198457a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/future.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ future_check_features(PyFutureFeatures *ff, node *n, char *filename)
1919

2020
REQ(n, import_stmt); /* must by from __future__ import ... */
2121

22-
for (i = 3; i < NCH(n); ++i) {
22+
for (i = 3; i < NCH(n); i += 2) {
2323
ch = CHILD(n, i);
2424
if (TYPE(ch) == STAR) {
2525
PyErr_SetString(PyExc_SyntaxError,

0 commit comments

Comments
 (0)