diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-07-04 18:39:48 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-07-04 18:39:48 (GMT) |
commit | 0dce815c2b3dc66794e34cd589d6873003562707 (patch) | |
tree | fb79364c205428835a899d48802a30bf61dd8dbd /Modules/parsermodule.c | |
parent | 1b9b5727cc85c4aec17c2fa79f9491d986dbb00e (diff) | |
download | cpython-0dce815c2b3dc66794e34cd589d6873003562707.zip cpython-0dce815c2b3dc66794e34cd589d6873003562707.tar.gz cpython-0dce815c2b3dc66794e34cd589d6873003562707.tar.bz2 |
Merged revisions 82555 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82555 | mark.dickinson | 2010-07-04 19:38:57 +0100 (Sun, 04 Jul 2010) | 2 lines
Issue #9130: Validate ellipsis tokens in relative imports.
........
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r-- | Modules/parsermodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index c9150d9..77b890a 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -1750,17 +1750,17 @@ validate_import_name(node *tree) && validate_dotted_as_names(CHILD(tree, 1))); } -/* Helper function to count the number of leading dots in +/* Helper function to count the number of leading dots (or ellipsis tokens) in * 'from ...module import name' */ static int count_from_dots(node *tree) { - int i; - for (i = 1; i < NCH(tree); i++) - if (TYPE(CHILD(tree, i)) != DOT) - break; - return i-1; + int i; + for (i = 1; i < NCH(tree); i++) + if (TYPE(CHILD(tree, i)) != DOT && TYPE(CHILD(tree, i)) != ELLIPSIS) + break; + return i - 1; } /* import_from: ('from' ('.'* dotted_name | '.'+) |