Index: Lib/test/test_parser.py =================================================================== --- Lib/test/test_parser.py (revision 66808) +++ Lib/test/test_parser.py (working copy) @@ -163,6 +163,7 @@ "from sys.path import (dirname, basename as my_basename)") self.check_suite( "from sys.path import (dirname, basename as my_basename,)") + self.check_suite("from .bogus import x") def test_basic_import_statement(self): self.check_suite("import sys") Index: Modules/parsermodule.c =================================================================== --- Modules/parsermodule.c (revision 66808) +++ Modules/parsermodule.c (working copy) @@ -1681,10 +1681,10 @@ 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 ')' |