alecthomas / importmagic

A Python library for finding unresolved symbols in Python code, and the corresponding imports
BSD 2-Clause "Simplified" License
120 stars 20 forks source link

Handle python 3 '...' tokens #37

Closed paradoxxxzero closed 8 years ago

paradoxxxzero commented 8 years ago

For some reason here in python 3, when I have imports with several dots they are grouped by 3 (like an ellipsis):

$ python -c "import tokenize,io;print([t[1] for t in tokenize.generate_tokens(io.StringIO('from ....app import app').readline)])"
['from', '...', '.', 'app', 'import', 'app', '']

this leads to imports not containing all the needed dots.

This PR seems to fix this problem.

paradoxxxzero commented 8 years ago

Thanks! Could you micro release this patch ?