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