mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Only purge pip when needed
This commit is contained in:
parent
d2f98cacea
commit
bcbe9a20fd
1 changed files with 6 additions and 1 deletions
|
@ -89,7 +89,6 @@ def pip_has_exceptions_mod(ver):
|
|||
)
|
||||
|
||||
|
||||
purge_pip()
|
||||
try:
|
||||
import pip
|
||||
HAS_PIP = True
|
||||
|
@ -98,6 +97,12 @@ except ImportError:
|
|||
|
||||
|
||||
if HAS_PIP is True:
|
||||
if not hasattr(purge_pip, '__pip_ver__'):
|
||||
purge_pip.__pip_ver__ = pip.__version__
|
||||
elif purge_pip.__pip_ver__ != pip.__version__:
|
||||
purge_pip()
|
||||
import pip
|
||||
purge_pip.__pip_ver__ = pip.__version__
|
||||
if pip_has_internal_exceptions_mod(pip.__version__):
|
||||
from pip._internal.exceptions import InstallationError # pylint: disable=E0611,E0401
|
||||
elif pip_has_exceptions_mod(pip.__version__):
|
||||
|
|
Loading…
Add table
Reference in a new issue