@@ -494,15 +494,15 @@ def _install_from_url(url, patch=None, extra_opts=[], add_cflags="", ignore_erro
494494 cppflags = os .environ .get ("CPPFLAGS" , "" )
495495 cflags = "-v " + os .environ .get ("CFLAGS" , "" ) + ((" " + add_cflags ) if add_cflags else "" )
496496
497- if os .system ("curl -o %s/%s %s" % (tempdir , name , url )) != 0 :
497+ if os .system ("curl -L - o %s/%s %s" % (tempdir , name , url )) != 0 :
498498 # honor env var 'HTTP_PROXY' and 'HTTPS_PROXY'
499499 env = os .environ
500500 curl_opts = []
501501 if url .startswith ("http://" ) and "HTTP_PROXY" in env :
502502 curl_opts += ["--proxy" , env ["HTTP_PROXY" ]]
503503 elif url .startswith ("https://" ) and "HTTPS_PROXY" in env :
504504 curl_opts += ["--proxy" , env ["HTTPS_PROXY" ]]
505- system ("curl %s -o %s/%s %s" % (" " .join (curl_opts ), tempdir , name , url ), msg = "Download error" )
505+ system ("curl -L %s -o %s/%s %s" % (" " .join (curl_opts ), tempdir , name , url ), msg = "Download error" )
506506
507507 if name .endswith (".tar.gz" ):
508508 system ("tar xzf %s/%s -C %s" % (tempdir , name , tempdir ), msg = "Error extracting tar.gz" )
@@ -544,7 +544,8 @@ def install_from_pypi(package, patch=None, extra_opts=[], add_cflags="", ignore_
544544 # this is already the url to the actual package
545545 pass
546546 else :
547- r = subprocess .check_output ("curl %s" % url , shell = True ).decode ("utf8" )
547+ r = subprocess .check_output ("curl -L %s" % url , shell = True ).decode ("utf8" )
548+ url = None
548549 try :
549550 urls = json .loads (r )["urls" ]
550551 except :
0 commit comments