Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isort removes imports imported as 2 symbols #1523

Closed
sebns opened this issue Oct 4, 2020 · 2 comments · Fixed by hypothesis/viahtml#107 or wwade/jobrunner#63
Closed

isort removes imports imported as 2 symbols #1523

sebns opened this issue Oct 4, 2020 · 2 comments · Fixed by hypothesis/viahtml#107 or wwade/jobrunner#63
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sebns
Copy link

sebns commented Oct 4, 2020

When running isort (without specific option):

$ isort .

On this code:

from selenium.webdriver import Remote, Remote as Driver
def make_driver() -> Driver:
    driver = Remote()
    return driver

The output generated is:

Actual:

from selenium.webdriver import Remote as Driver

Expected:

from selenium.webdriver import Remote, Remote as Driver

It was expected to be unchanged because Remote is imported and used as 2 distinct symbols (Remote and Driver). Now the code after running isort fails as Remote is not defined anymore.

I am using isort==5.5.4 with python 3.8.

@sebns sebns changed the title isort removes imports imported a 2 symbols isort removes imports imported as 2 symbols Oct 4, 2020
@timothycrosley timothycrosley added the bug Something isn't working label Oct 4, 2020
@timothycrosley timothycrosley self-assigned this Oct 5, 2020
@timothycrosley timothycrosley added this to the 5.6.0 milestone Oct 5, 2020
timothycrosley added a commit that referenced this issue Oct 5, 2020
timothycrosley added a commit that referenced this issue Oct 5, 2020
@timothycrosley
Copy link
Member

This has been fixed in develop and will be released in version 5.6.0 of isort shortly

@timothycrosley
Copy link
Member

Update: this has just been released to PyPI in 5.6.0 release of isort: https://pycqa.github.io/isort/CHANGELOG/#560-october-7-2020

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment