Closed ziima closed 3 years ago
Fixed also loading of isort config.
Great! I'll review it later today, but thanks in advance :)
It has a bug, it won't work when no isort is present (will raise an ImportError). This is because of this structure:
try:
# import isort 5
except ImportError:
# import isort older
except ImportError:
# handle no insort
If the bit that tries to import an older isort fails, the second except won't be used. In python, the excepts only apply to the code from the try block, they don't apply to other except blocks. If you want to catch a possible exception inside an except block, you need a new try/except, like this:
try:
# import isort 5
except ImportError:
try:
# import isort older
except ImportError:
# handle no insort
:facepalm: Fixed.
Merged! thanks for the fix :)
Fix for the change of API in isort.