mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
backport r67077 from the trunk: parser module now correctly validates relative imports
This commit is contained in:
parent
3b335ff340
commit
6f08e85ad9
4 changed files with 7 additions and 2 deletions
|
@ -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 ')' |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue