File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -662,11 +662,9 @@ def test2(self):
662662 # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
663663 xml = b"<?xml version\xc2 \x85 ='1.0'?>\r \n "
664664 parser = expat .ParserCreate ()
665- try :
665+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
666+ with self .assertRaisesRegex (expat .ExpatError , err_pattern ):
666667 parser .Parse (xml , True )
667- self .fail ()
668- except expat .ExpatError as e :
669- self .assertEqual (str (e ), 'XML declaration not well-formed: line 1, column 14' )
670668
671669class ErrorMessageTest (unittest .TestCase ):
672670 def test_codes (self ):
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ Core and Builtins
1313Library
1414-------
1515
16+ Tests
17+ -----
18+
19+ - Issue #27369: In test_pyexpat, avoid testing an error message detail that
20+ changed in Expat 2.2.0.
21+
1622
1723What's New in Python 3.4.5?
1824===========================
You can’t perform that action at this time.
0 commit comments