Updated pip_state to work with pip 8.0

Pip 8.0.0 added an InstallationError exception. Updated the state to catch that
exception properly.
This commit is contained in:
justinta89 2016-01-20 11:03:18 -07:00
parent 5c7cc51937
commit baa274bca9

View file

@ -47,6 +47,12 @@ if HAS_PIP is True:
if 'pip' in sys.modules:
del sys.modules['pip']
pip_ver = tuple(pip.__version__.split('.'))
if pip_ver >= (8, 0, 0):
from pip.exceptions import InstallationError
else:
InstallationError = ValueError
logger = logging.getLogger(__name__)
# Define the module's virtual name