mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #21774: Fix incorrect variable in xml.dom.minidom
This commit is contained in:
parent
ef8abfc082
commit
92a4055343
3 changed files with 12 additions and 1 deletions
|
@ -1531,6 +1531,13 @@ class MinidomTest(unittest.TestCase):
|
|||
num_children_after = len(doc.childNodes)
|
||||
self.assertTrue(num_children_after == num_children_before - 1)
|
||||
|
||||
def testProcessingInstructionNameError(self):
|
||||
# wrong variable in .nodeValue property will
|
||||
# lead to "NameError: name 'data' is not defined"
|
||||
doc = parse(tstfile)
|
||||
pi = doc.createProcessingInstruction("y", "z")
|
||||
pi.nodeValue = "crash"
|
||||
|
||||
def test_main():
|
||||
run_unittest(MinidomTest)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue