]> granicus.if.org Git - python/commitdiff
When open_urlresource() fails, HTTPException is another possible error
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 26 Nov 2009 12:36:30 +0000 (12:36 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 26 Nov 2009 12:36:30 +0000 (12:36 +0000)
Lib/test/test_multibytecodec_support.py
Lib/test/test_normalization.py

index cf7f288a285a445827eb26331d6f3dfa1825b977..3afe3a9ae15a425ce68e36b8c07b5f2114829e14 100644 (file)
@@ -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):
index 6a7574143fd97cb83c5ea3d61cc994b713a300d0..f9f4f68a201716292049e23c502c7084c1a1dee3 100644 (file)
@@ -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: