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