Blame SOURCES/00378-support-expat-2-4-5.patch

3a1cd0
From db083095e3bdb93e4f8170d814664c482b1e94da Mon Sep 17 00:00:00 2001
3a1cd0
From: rpm-build <rpm-build>
3a1cd0
Date: Tue, 14 Jun 2022 06:38:43 +0200
3a1cd0
Subject: [PATCH] Fix test suite for Expat >= 2.4.5
3a1cd0
3a1cd0
---
3a1cd0
 Lib/test/test_minidom.py | 17 +++++------------
3a1cd0
 1 file changed, 5 insertions(+), 12 deletions(-)
3a1cd0
3a1cd0
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
3a1cd0
index 9762025..5f52ed1 100644
3a1cd0
--- a/Lib/test/test_minidom.py
3a1cd0
+++ b/Lib/test/test_minidom.py
3a1cd0
@@ -1149,14 +1149,10 @@ class MinidomTest(unittest.TestCase):
3a1cd0
 
3a1cd0
         # Verify that character decoding errors raise exceptions instead
3a1cd0
         # of crashing
3a1cd0
-        if pyexpat.version_info >= (2, 4, 5):
3a1cd0
-            self.assertRaises(ExpatError, parseString,
3a1cd0
-                    b'<fran\xe7ais></fran\xe7ais>')
3a1cd0
-            self.assertRaises(ExpatError, parseString,
3a1cd0
-                    b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>')
3a1cd0
-        else:
3a1cd0
-            self.assertRaises(UnicodeDecodeError, parseString,
3a1cd0
-                b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
3a1cd0
+        self.assertRaises(ExpatError, parseString,
3a1cd0
+                b'<fran\xe7ais></fran\xe7ais>')
3a1cd0
+        self.assertRaises(ExpatError, parseString,
3a1cd0
+                b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>')
3a1cd0
 
3a1cd0
         doc.unlink()
3a1cd0
 
3a1cd0
@@ -1617,10 +1613,7 @@ class MinidomTest(unittest.TestCase):
3a1cd0
         self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
3a1cd0
 
3a1cd0
     def testExceptionOnSpacesInXMLNSValue(self):
3a1cd0
-        if pyexpat.version_info >= (2, 4, 5):
3a1cd0
-            context = self.assertRaisesRegex(ExpatError, 'syntax error')
3a1cd0
-        else:
3a1cd0
-            context = self.assertRaisesRegex(ValueError, 'Unsupported syntax')
3a1cd0
+        context = self.assertRaisesRegex(ExpatError, 'syntax error')
3a1cd0
 
3a1cd0
         with context:
3a1cd0
             parseString('<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>')
3a1cd0
-- 
3a1cd0
2.35.3
3a1cd0