@@ -494,15 +494,15 @@ def _install_from_url(http://github.com/url,%20patch=None,%20extra_opts=[],%20add_cflags="",%20ignore_erro%3C/div%3E%3C/code%3E%3C/div%3E%3C/td%3E%3C/tr%3E%3Ctr%20class=%22diff-line-row%22%3E%3Ctd%20data-grid-cell-id=%22diff-9da6d4f868a682101892131546ac686b9da38342bdd51f1e173985ea834bd45b-494-494-0%22%20data-selected=%22false%22%20role=%22gridcell%22%20style=%22background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">494
494
cppflags = os .environ .get ("CPPFLAGS" , "" )
495
495
cflags = "-v " + os .environ .get ("CFLAGS" , "" ) + ((" " + add_cflags ) if add_cflags else "" )
496
496
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 :
498
498
# honor env var 'HTTP_PROXY' and 'HTTPS_PROXY'
499
499
env = os .environ
500
500
curl_opts = []
501
501
if url .startswith ("http://" ) and "HTTP_PROXY" in env :
502
502
curl_opts += ["--proxy" , env ["HTTP_PROXY" ]]
503
503
elif url .startswith ("https://" ) and "HTTPS_PROXY" in env :
504
504
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" )
506
506
507
507
if name .endswith (".tar.gz" ):
508
508
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_
544
544
# this is already the url to the actual package
545
545
pass
546
546
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
548
549
try :
549
550
urls = json .loads (r )["urls" ]
550
551
except :
0 commit comments