]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 76535 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 26 Nov 2009 12:38:23 +0000 (12:38 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 26 Nov 2009 12:38:23 +0000 (12:38 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76535 | antoine.pitrou | 2009-11-26 13:36:30 +0100 (jeu., 26 nov. 2009) | 3 lines

  When open_urlresource() fails, HTTPException is another possible error
........

Lib/test/test_multibytecodec_support.py
Lib/test/test_normalization.py

index e4036bf2c6a660f5fc5185704213ef0977ea6531..75b3363854892759631570977521beba9cf2792c 100644 (file)
@@ -6,6 +6,7 @@
 
 import sys, codecs
 import unittest, re
+from http.client import HTTPException
 from test import support
 from io import BytesIO
 
@@ -278,7 +279,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 664155473464e89b4e50e1a3e052cdaab4cd2f89..19fe48d73118b63bc7d6c3eb02e9df00e485aa45 100644 (file)
@@ -1,6 +1,7 @@
 from test.support import run_unittest, open_urlresource
 import unittest
 
+from http.client import HTTPException
 import sys
 import os
 from unicodedata import normalize, unidata_version
@@ -45,7 +46,7 @@ class NormalizationTest(unittest.TestCase):
         # Hit the exception early
         try:
             open_urlresource(TESTDATAURL, encoding="utf-8")
-        except IOError:
+        except (IOError, HTTPException):
             self.skipTest("Could not retrieve " + TESTDATAURL)
         for line in open_urlresource(TESTDATAURL, encoding="utf-8"):
             if '#' in line: