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

Prevent single trailing symbol with max_columns #54

Closed pilat closed 5 years ago

pilat commented 5 years ago

Hello!

When I try import module from long path I will get unnecessary trailing symbol.

For example, when I set max_columns=80 and try to import stuff from module_with_long_name.classes.some_prefix.another_prefix.waffle I will get this:

from module_with_long_name.classes.some_prefix.another_prefix.waffle import ,
    stuff

I hope that I solved this problem in this PR.

alecthomas commented 5 years ago

Nice, thanks!