diff options
author | Christian Heimes <christian@python.org> | 2021-03-08 11:25:48 +0100 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2021-03-08 11:30:31 +0100 |
commit | 35ebedca6fb072b25a177d5446f9a1bf176d581a (patch) | |
tree | ca05548088327a20584cb39996b250af5d31bb9e /tests.py | |
parent | 1ac00c6dcb7696b960611ebdd80964907d7d07ae (diff) | |
download | defusedxml-git-35ebedca6fb072b25a177d5446f9a1bf176d581a.tar.gz |
Fix regression defusedxml.ElementTree.ParseError
The ``defusedxml.ElementTree.ParseError`` exception is now the same class object
as ``xml.etree.ElementTree.ParseError`` again. The regression was
introduced by new patching code as part of PR #60.
See: https://github.com/tiran/defusedxml/pull/60
Fixes: https://github.com/tiran/defusedxml/issues/63
Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -218,6 +218,15 @@ class TestDefusedElementTree(BaseTests): self.assertIs(orig_elementtree, second_elementtree) + def test_orig_parseerror(self): + # https://github.com/tiran/defusedxml/issues/63 + self.assertIs(self.module.ParseError, orig_elementtree.ParseError) + try: + self.parseString("invalid") + except Exception as e: + self.assertIsInstance(e, orig_elementtree.ParseError) + self.assertIsInstance(e, self.module.ParseError) + class TestDefusedcElementTree(TestDefusedElementTree): module = cElementTree |