[Python-checkins] r43413 - sandbox/trunk/setuptools/setuptools/package_index.py
phillip.eby
python-checkins at python.org
Wed Mar 29 01:06:58 CEST 2006
Author: phillip.eby
Date: Wed Mar 29 01:06:58 2006
New Revision: 43413
Modified:
sandbox/trunk/setuptools/setuptools/package_index.py
Log:
Fall back to a reasonable default Sourceforge address if the machine is
unable to obtain the mirror IP list via DNS.
Modified: sandbox/trunk/setuptools/setuptools/package_index.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/package_index.py (original)
+++ sandbox/trunk/setuptools/setuptools/package_index.py Wed Mar 29 01:06:58 2006
@@ -623,7 +623,11 @@
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)
@@ -650,7 +654,3 @@
-
-
-
-
More information about the Python-checkins
mailing list