diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-11-03 15:14:51 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-11-03 15:14:51 (GMT) |
commit | 6624a9fdddc3d77a426173f22ab941e8e279dec7 (patch) | |
tree | 559996f8531c3aac857bf53047791d911653901e /Modules | |
parent | 8928a7e911357e57b92aa1738940fec241ded28e (diff) | |
download | cpython-6624a9fdddc3d77a426173f22ab941e8e279dec7.zip cpython-6624a9fdddc3d77a426173f22ab941e8e279dec7.tar.gz cpython-6624a9fdddc3d77a426173f22ab941e8e279dec7.tar.bz2 |
#4048 make the parser module accept relative imports as valid
Diffstat (limited to 'Modules')
-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 423a0b3..bea78c2 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -1879,10 +1879,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 ')' | |