Commit 2dc7c55b authored by Eric Coissac's avatar Eric Coissac

No commit message

No commit message
parent bc0378b3
......@@ -36,12 +36,16 @@ def is_pip_installed(minversion=PIP_MINVERSION):
ok = False"A too old version of pip is installed on your system")
for m in [x for x in sys.modules if x.startswith('pip.' or x=='pip')]:
# We clean up the imported pip module for test purpose
for m in [x for x in sys.modules if x.startswith('pip.')]:
del sys.modules[m]
del sys.modules['pip']
except Exception,e:
ok = False"No pip installed on your system")"No pip installed on your system")
return ok
......@@ -57,8 +61,7 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
if 'http_proxy' in os.environ and 'https_proxy' not in os.environ:
pipinstallscript = urllib2.urlopen('')
except Exception,e:
raise DistutilsError,"Pip (>=%s) is not install on your system and I cannot install it" % PIP_MINVERSION
script =
......@@ -72,7 +75,6 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
pip_zip = os.path.join(tmpdir, "")
print pip_zip
with open(pip_zip, "wb") as fp:"Installing temporary pip...")
......@@ -84,11 +86,10 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
pip = zi.load_module("pip")
import pip
pip = importlib.import_module('pip')
print pip.__file__
# Prepare the CERT certificat for https download
cert_path = os.path.join(tmpdir, "cacert.pem")
......@@ -100,9 +101,8 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
os.environ.setdefault("PIP_CERT", cert_path)
assert hasattr(pip,'__version__') and LooseVersion(pip.__version__) >= minversion, \
"Unable to find suitable version of pip get %s instead of %s" % (pipmodule.__version__,
assert hasattr(pip,'__version__') and LooseVersion(pip.__version__) >= LooseVersion(minversion), \
"Unable to find suitable version of pip"
return local_pip[0]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment