Fix for unless requisite when pip is not installed

This commit is contained in:
Daniel A. Wozniak 2020-02-20 21:07:07 +00:00
parent 2f783d247e
commit 9d23f55adc
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61

View file

@ -96,21 +96,8 @@ try:
HAS_PIP = True
except ImportError:
HAS_PIP = False
# Remove references to the loaded pip module above so reloading works
import sys
pip_related_entries = [
(k, v) for (k, v) in sys.modules.items()
or getattr(v, '__module__', '').startswith('pip.')
or (isinstance(v, types.ModuleType) and v.__name__.startswith('pip.'))
]
for name, entry in pip_related_entries:
sys.modules.pop(name)
del entry
purge_pip()
del pip
sys_modules_pip = sys.modules.pop('pip', None)
if sys_modules_pip is not None:
del sys_modules_pip
if HAS_PIP is True:
if not hasattr(purge_pip, '__pip_ver__'):