Skip to content

Fails when importing __future__ as renaming it #389

@horta

Description

@horta

Operating system: Darwin horta-ml 17.6.0 Darwin Kernel Version 17.6.0
Python version: Python 3.6.6 :: Anaconda custom (64-bit)
Black version: 18.6b4
Does also happen on master: yes

This works:

# test1.py
from __future__ import absolute_import

This does not work:

# test2.py
from __future__ import absolute_import as _absolute_import

Output:

error: cannot format test2.py:
All done! 💥 💔 💥
1 file failed to reformat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions