Issue #21774: Fix incorrect variable in xml.dom.minidom

This commit is contained in:
Raymond Hettinger 2014-06-15 14:48:19 -07:00
parent ef8abfc082
commit 92a4055343
3 changed files with 12 additions and 1 deletions

View file

@ -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)