mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
method doesn't require an argument again.
This commit is contained in:
parent
6f80f5d444
commit
e26d3af7ee
3 changed files with 14 additions and 1 deletions
|
@ -641,6 +641,16 @@ class ForeignDTDTests(unittest.TestCase):
|
|||
parser.Parse("<?xml version='1.0'?><element/>")
|
||||
self.assertEqual(handler_call_args, [(None, None)])
|
||||
|
||||
# test UseForeignDTD() is equal to UseForeignDTD(True)
|
||||
handler_call_args[:] = []
|
||||
|
||||
parser = expat.ParserCreate()
|
||||
parser.UseForeignDTD()
|
||||
parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
|
||||
parser.ExternalEntityRefHandler = resolve_entity
|
||||
parser.Parse("<?xml version='1.0'?><element/>")
|
||||
self.assertEqual(handler_call_args, [(None, None)])
|
||||
|
||||
def test_ignore_use_foreign_dtd(self):
|
||||
"""
|
||||
If UseForeignDTD is passed True and a document with an external
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue