Commit 89111e61 authored by Jim Fulton's avatar Jim Fulton

Changed setuptools.package_index.PackageIndex.open_url to include the

url in the exception.

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4054241
parent 08f3761c
......@@ -581,7 +581,9 @@ class PackageIndex(Environment):
return v
except urllib2.URLError, v:
if warning: self.warn(warning, v.reason)
else: raise DistutilsError("Download error: %s" % v.reason)
else:
raise DistutilsError("Download error for %s: %s"
% (url, v.reason))
def _download_url(self, scheme, url, tmpdir):
# Determine download filename
......
"""Package Index Tests
"""
# More would be better!
import os, shutil, tempfile, unittest
import pkg_resources
import setuptools.package_index
class TestPackageIndex(unittest.TestCase):
def test_bad_urls(self):
index = setuptools.package_index.PackageIndex()
url = 'http://127.0.0.1/nonesuch/test_package_index'
try:
index.open_url(url)
except Exception, v:
self.assert_(url in str(v))
else:
self.assert_(False)
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