aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_packageindex.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-05-18 15:43:21 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-05-18 15:43:21 -0400
commitadc4fbb184e9b410744cc1c91d4832b2235de2a7 (patch)
tree228966428d3bc20e3e83fb478bd9fcdceb30f952 /setuptools/tests/test_packageindex.py
parent1e64c9a55bc6e7b4560966b95c831d6ee8276295 (diff)
downloadexternal_python_setuptools-adc4fbb184e9b410744cc1c91d4832b2235de2a7.tar.gz
external_python_setuptools-adc4fbb184e9b410744cc1c91d4832b2235de2a7.tar.bz2
external_python_setuptools-adc4fbb184e9b410744cc1c91d4832b2235de2a7.zip
Fixed failing test on Python 2.7.3 (and probably other recent patch releases)
--HG-- branch : distribute extra : rebase_source : 02f36e126ad338fb224b0904cce9eca61269ea0a
Diffstat (limited to 'setuptools/tests/test_packageindex.py')
-rw-r--r--setuptools/tests/test_packageindex.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 3a8808f7..5e424dd6 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -4,6 +4,8 @@ import sys
import unittest
import urllib2
import pkg_resources
+import httplib
+import distutils.errors
import setuptools.package_index
from server import IndexServer
@@ -66,8 +68,12 @@ class TestPackageIndex(unittest.TestCase):
url = 'http://http://svn.pythonpaste.org/Paste/wphp/trunk'
try:
index.open_url(url)
- except Exception, v:
- self.assert_('nonnumeric port' in str(v))
+ except distutils.errors.DistutilsError, error:
+ # Python 2.7.3
+ self.assert_('getaddrinfo failed' in str(error))
+ except httplib.InvalidURL, error:
+ # Python 2.7.2 and earlier
+ self.assert_('nonnumeric port' in str(error))
def test_bad_url_screwy_href(self):
index = setuptools.package_index.PackageIndex(