Avoid truncating module names without a period
When sorting a file with a third party library that is similarly named to a
standard library module in this case) the `index` variable was set to `-1`
which evaluates to `True` in the conditional thus truncating the last
character from the moduleName. In the case of times [1] you end up with
firstPart being `time`, a standard library module.
Tested with these imports:
import times
import datetime
import requests
Running isort 3.7.0 on python 2.7.6.
1: https://pypi.python.org/pypi/times
Loading
Please register or sign in to comment