caniusepython3 icon indicating copy to clipboard operation
caniusepython3 copied to clipboard

`unicode_literals` import isn't detected if part of a multiline import statement

Open wyattanderson opened this issue 6 years ago • 1 comments

Thanks for this helpful tool! We're excited to incorporate it into our workflow. I found one very slightly inconvenient bug when futurizing a particular file added the following from __future__ imports:

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals

Subsequently running isort reduces this to:

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

Now, errors about native string literals appear where they otherwise would not, assumedly because this check only checks for the presence of unicode_literals on the same line only.

Happy to take a whack at a PR.

wyattanderson avatar May 08 '19 16:05 wyattanderson

A PR would be appreciated!

brettcannon avatar May 09 '19 21:05 brettcannon