aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2007-01-24 15:42:26 +0000
committerPJ Eby <distutils-sig@python.org>2007-01-24 15:42:26 +0000
commit2dd7ed9ccf64f5136c0e6fc8f9bd8216fde53cf2 (patch)
treed204a88d560d7b30e888633c9d85ecbc70eacf1b /setuptools/package_index.py
parentba006a1c6da9674ab91b5b0e6be616c06ec00799 (diff)
downloadexternal_python_setuptools-2dd7ed9ccf64f5136c0e6fc8f9bd8216fde53cf2.tar.gz
external_python_setuptools-2dd7ed9ccf64f5136c0e6fc8f9bd8216fde53cf2.tar.bz2
external_python_setuptools-2dd7ed9ccf64f5136c0e6fc8f9bd8216fde53cf2.zip
EasyInstall no longer aborts the installation process if a URL it wants to
retrieve can't be downloaded, unless the URL is an actual package download. Instead, it issues a warning and tries to keep going. (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053542
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index f6bc45f5..d3f3f561 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -166,7 +166,6 @@ class PackageIndex(Environment):
"""Evaluate a URL as a possible download, and maybe retrieve it"""
if url in self.scanned_urls and not retrieve:
return
-
self.scanned_urls[url] = True
if not URL_SCHEME(url):
self.process_filename(url)
@@ -187,7 +186,8 @@ class PackageIndex(Environment):
return
self.info("Reading %s", url)
- f = self.open_url(url)
+ f = self.open_url(url, "Download error: %s -- Some packages may not be found!")
+ if f is None: return
self.fetched_urls[url] = self.fetched_urls[f.url] = True
if 'html' not in f.headers.get('content-type', '').lower():
@@ -572,7 +572,7 @@ class PackageIndex(Environment):
pass # no-op
- def open_url(self, url):
+ def open_url(self, url, warning=None):
if url.startswith('file:'):
return local_open(url)
try:
@@ -580,7 +580,8 @@ class PackageIndex(Environment):
except urllib2.HTTPError, v:
return v
except urllib2.URLError, v:
- raise DistutilsError("Download error: %s" % v.reason)
+ if warning: self.warn(warning, v.reason)
+ else: raise DistutilsError("Download error: %s" % v.reason)
def _download_url(self, scheme, url, tmpdir):
# Determine download filename
@@ -612,7 +613,6 @@ class PackageIndex(Environment):
self.process_url(url, True)
-
def _attempt_download(self, url, filename):
headers = self._download_to(url, filename)
if 'html' in headers['content-type'].lower():