File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -858,9 +858,13 @@ def space_path2url(p):
858
858
import tempfile
859
859
import os
860
860
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")
862
867
863
- cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
864
868
if cert_data is not None:
865
869
cert_file = tempfile.NamedTemporaryFile(delete=False)
866
870
cert_file.write(cert_data)
@@ -874,7 +878,7 @@ def space_path2url(p):
874
878
args += ["--cert", cert_file.name]
875
879
args += sys.argv[1:]
876
880
877
- sys.exit(pip.main (args))
881
+ sys.exit(_main (args))
878
882
finally:
879
883
if cert_file is not None:
880
884
os.remove(cert_file.name)
You can’t perform that action at this time.
0 commit comments