aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorHanno Schlichting <hanno@hannosch.eu>2009-10-24 01:24:05 +0200
committerHanno Schlichting <hanno@hannosch.eu>2009-10-24 01:24:05 +0200
commit9b02ba04ef7690724330d3d8ff35cd38284d3b07 (patch)
tree50f989e2ec8a37fd923a4cdd94850f2cd7183f0d /setuptools/package_index.py
parent43d34734c801d2d9a72d5fa6e7fc74d80bdc11c1 (diff)
downloadexternal_python_setuptools-9b02ba04ef7690724330d3d8ff35cd38284d3b07.tar.gz
external_python_setuptools-9b02ba04ef7690724330d3d8ff35cd38284d3b07.tar.bz2
external_python_setuptools-9b02ba04ef7690724330d3d8ff35cd38284d3b07.zip
Issue 21: Allow PackageIndex.open_url to gracefully handle all cases of a httplib.HTTPException instead of just InvalidURL and BadStatusLine.
--HG-- branch : distribute extra : rebase_source : 24986ae1074b564fbd8c34a227265afd3b90ebce
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 98799de5..ee980214 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -602,6 +602,12 @@ class PackageIndex(Environment):
raise DistutilsError('%s returned a bad status line. '
'The server might be down, %s' % \
(url, v.line))
+ except httplib.HTTPException, v:
+ if warning:
+ self.warn(warning, v)
+ else:
+ raise DistutilsError("Download error for %s: %s"
+ % (url, v))
def _download_url(self, scheme, url, tmpdir):
# Determine download filename