anaconda
anaconda copied to clipboard
Import Validation falsely detects conditional imports as not installed
Expected Behaviour
Import validator detects the conditional import as not found only if it is actually not found.
Actual Behaviour
Import validator detects conditional import as a not found when it should be found. In the example, I use the stdlib abc module as a conditional import to demonstrate. abc is present in nearly every standard Python 3 installation out there.
Steps to Reproduce
- Setup a test sublime project with the following settings (put in your python3.6 installation, I use virtualenvs) and open it.
{
"settings":
{
"anaconda_linting": true,
"anaconda_linting_behaviour": "always",
"python_interpreter": "~/.virtualenvs/cpython36/bin/python3.6",
"validate_imports": true
}
}
- Create a test.py file with:
try:
import abc
except ImportError:
'never happens'
else:
abc = None
- Observe:

ST3, Anaconda and OS versions
- ST3, Build 3143
- Anaconda 2.1.26
- OSX 16.7.0
ST3 Console Logs
reloading /Users/BenJolitz/software/geotools/test.sublime-project
Anaconda's JsonServer Logs
https://gist.github.com/benjolitz/6fcc73bd69a342a2d72cfc9cd437a2d6