Skip to content

Commit e916509

Browse files
authored
Merge pull request #1094 from pradyunsg/patch-1
Adapt for changes in next pip release
2 parents e592265 + 64f61b7 commit e916509

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

virtualenv.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,13 @@ def space_path2url(p):
858858
import tempfile
859859
import os
860860
861-
import pip
861+
try:
862+
from pip._internal import main as _main
863+
cert_data = pkgutil.get_data("pip._vendor.certifi", "cacert.pem")
864+
except ImportError:
865+
from pip import main as _main
866+
cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
862867
863-
cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
864868
if cert_data is not None:
865869
cert_file = tempfile.NamedTemporaryFile(delete=False)
866870
cert_file.write(cert_data)
@@ -874,7 +878,7 @@ def space_path2url(p):
874878
args += ["--cert", cert_file.name]
875879
args += sys.argv[1:]
876880
877-
sys.exit(pip.main(args))
881+
sys.exit(_main(args))
878882
finally:
879883
if cert_file is not None:
880884
os.remove(cert_file.name)

0 commit comments

Comments
 (0)