diff options
| author | Benjamin Peterson <benjamin@python.org> | 2008-11-03 15:19:35 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2008-11-03 15:19:35 (GMT) |
| commit | 6f08e85ad97fc99dde46848167fa3310c4275c32 (patch) | |
| tree | 2ab79dc61d2d66da28f939237ec7beada2705f44 /Modules/parsermodule.c | |
| parent | 3b335ff3402b1263e3fbf50ef6ba6e8cf2de1624 (diff) | |
| download | cpython-6f08e85ad97fc99dde46848167fa3310c4275c32.zip cpython-6f08e85ad97fc99dde46848167fa3310c4275c32.tar.gz cpython-6f08e85ad97fc99dde46848167fa3310c4275c32.tar.bz2 | |
backport r67077 from the trunk: parser module now correctly validates relative imports
Diffstat (limited to 'Modules/parsermodule.c')
| -rw-r--r-- | Modules/parsermodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index e33197e..e49e600 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -1804,10 +1804,10 @@ static int count_from_dots(node *tree) { int i; - for (i = 0; i < NCH(tree); i++) + for (i = 1; i < NCH(tree); i++) if (TYPE(CHILD(tree, i)) != DOT) break; - return i; + return i-1; } /* 'from' ('.'* dotted_name | '.') 'import' ('*' | '(' import_as_names ')' | |
