diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-26 12:36:30 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-26 12:36:30 (GMT) |
commit | 2dab865ff177f167886396bb162285f6dd24e668 (patch) | |
tree | dfd0da2fe009615cdf9d6db68f50f94399ae577a | |
parent | 0306894fb147ad960f072c67822c10f8bdfd094a (diff) | |
download | cpython-2dab865ff177f167886396bb162285f6dd24e668.zip cpython-2dab865ff177f167886396bb162285f6dd24e668.tar.gz cpython-2dab865ff177f167886396bb162285f6dd24e668.tar.bz2 |
When open_urlresource() fails, HTTPException is another possible error
-rw-r--r-- | Lib/test/test_multibytecodec_support.py | 3 | ||||
-rw-r--r-- | Lib/test/test_normalization.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py index cf7f288..3afe3a9 100644 --- a/Lib/test/test_multibytecodec_support.py +++ b/Lib/test/test_multibytecodec_support.py @@ -6,6 +6,7 @@ import sys, codecs import unittest, re +from httplib import HTTPException from test import test_support from StringIO import StringIO @@ -268,7 +269,7 @@ class TestBase_Mapping(unittest.TestCase): unittest.TestCase.__init__(self, *args, **kw) try: self.open_mapping_file() # test it to report the error early - except IOError: + except (IOError, HTTPException): self.skipTest("Could not retrieve "+self.mapfileurl) def open_mapping_file(self): diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index 6a75741..f9f4f68 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -1,6 +1,7 @@ from test.test_support import run_unittest, open_urlresource import unittest +from httplib import HTTPException import sys import os from unicodedata import normalize, unidata_version @@ -43,7 +44,7 @@ class NormalizationTest(unittest.TestCase): # Hit the exception early try: open_urlresource(TESTDATAURL) - except IOError: + except (IOError, HTTPException): self.skipTest("Could not retrieve " + TESTDATAURL) for line in open_urlresource(TESTDATAURL): if '#' in line: |