components/python/python35/patches/31-expat.patch
changeset 6929 e7955ccacd45
equal deleted inserted replaced
6928:52fa7ed60803 6929:e7955ccacd45
       
     1 This patch comes from upstream:
       
     2 
       
     3 http://bugs.python.org/issue27369
       
     4 
       
     5 --- a/Lib/test/test_pyexpat.py
       
     6 +++ b/Lib/test/test_pyexpat.py
       
     7 @@ -656,11 +656,9 @@ class MalformedInputTest(unittest.TestCa
       
     8          # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
       
     9          xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
       
    10          parser = expat.ParserCreate()
       
    11 -        try:
       
    12 +        err_pattern = r'XML declaration not well-formed: line 1, column \d+'
       
    13 +        with self.assertRaisesRegex(expat.ExpatError, err_pattern):
       
    14              parser.Parse(xml, True)
       
    15 -            self.fail()
       
    16 -        except expat.ExpatError as e:
       
    17 -            self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
       
    18  
       
    19  class ErrorMessageTest(unittest.TestCase):
       
    20      def test_codes(self):