PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.53k stars 583 forks source link

Retry section lookup for from+import statements, if defaulted #2168

Open thejcannon opened 1 year ago

thejcannon commented 1 year ago

Fixes https://github.com/PyCQA/isort/issues/2167 by issuing a second call to finder() using the joined parts of the from X import Y in case Y is a submodule, and X.Y was specified in a section. The second call is only issued if we match the default section with a default reasoning, so this should be fully backwards-compatible.