diff options
author | Raymond Hettinger <python@rcn.com> | 2014-06-15 21:48:19 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-06-15 21:48:19 (GMT) |
commit | 92a405534383927c48c8de2fc6bf06127ef2be78 (patch) | |
tree | 52f5b013c699b8c91f8a11ec0d96d98b33a00728 /Lib/test/test_minidom.py | |
parent | ef8abfc082daeb6e389dff8859640ed87da0cc12 (diff) | |
download | cpython-92a405534383927c48c8de2fc6bf06127ef2be78.zip cpython-92a405534383927c48c8de2fc6bf06127ef2be78.tar.gz cpython-92a405534383927c48c8de2fc6bf06127ef2be78.tar.bz2 |
Issue #21774: Fix incorrect variable in xml.dom.minidom
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r-- | Lib/test/test_minidom.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 5ab4bfe..2489ff7 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -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) |