Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_parser.py @ 62790:fb360c079059
Issue #9130: Validate ellipsis tokens in relative imports.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sun, 04 Jul 2010 18:38:57 +0000 |
| parents | d2830091237c |
| children | 9fe76c26ea9f |
line wrap: on
line diff
--- a/Lib/test/test_parser.py Sun Jul 04 18:15:26 2010 +0000 +++ b/Lib/test/test_parser.py Sun Jul 04 18:38:57 2010 +0000 @@ -192,8 +192,14 @@ def test_relative_imports(self): self.check_suite("from . import name") self.check_suite("from .. import name") + # check all the way up to '....', since '...' is tokenized + # differently from '.' (it's an ellipsis token). + self.check_suite("from ... import name") + self.check_suite("from .... import name") self.check_suite("from .pkg import name") self.check_suite("from ..pkg import name") + self.check_suite("from ...pkg import name") + self.check_suite("from ....pkg import name") def test_pep263(self): self.check_suite("# -*- coding: iso-8859-1 -*-\n"
