Commit 176f17c6 authored by PJ Eby's avatar PJ Eby

Fall back to a reasonable default Sourceforge address if the machine is

unable to obtain the mirror IP list via DNS.

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043413
parent fb76e721
......@@ -623,7 +623,11 @@ def fix_sf_url(url):
def get_sf_ip(_mirrors=[]):
if not _mirrors:
_mirrors[:] = socket.gethostbyname_ex('dl.sourceforge.net')[-1]
try:
_mirrors[:] = socket.gethostbyname_ex('dl.sourceforge.net')[-1]
except socket.error:
# DNS-bl0ck1n9 f1r3w4llz sUx0rs!
_mirrors[:] = ['dl.sourceforge.net']
return random.choice(_mirrors)
......@@ -645,10 +649,6 @@ def get_sf_ip(_mirrors=[]):
......
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