]> granicus.if.org Git - python/commitdiff
When iterating over the names imported in a future statement, ignore the
authorFred Drake <fdrake@acm.org>
Sat, 10 Mar 2001 02:15:37 +0000 (02:15 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 10 Mar 2001 02:15:37 +0000 (02:15 +0000)
commas in the concrete syntax; checking those causes a segfault.

This fixes SF bug #407394.

Python/future.c

index 89466f0699e96a68305617280f87fc647993d3b0..cf2dca5ea5acd8555e875a9f1d0a2492653e6bd5 100644 (file)
@@ -19,7 +19,7 @@ future_check_features(PyFutureFeatures *ff, node *n, char *filename)
 
        REQ(n, import_stmt); /* must by from __future__ import ... */
 
-       for (i = 3; i < NCH(n); ++i) {
+       for (i = 3; i < NCH(n); i += 2) {
                ch = CHILD(n, i);
                if (TYPE(ch) == STAR) {
                        PyErr_SetString(PyExc_SyntaxError,