mirror of https://github.com/python/cpython
merge
This commit is contained in:
commit
f46933a42f
|
@ -1531,6 +1531,13 @@ class MinidomTest(unittest.TestCase):
|
||||||
num_children_after = len(doc.childNodes)
|
num_children_after = len(doc.childNodes)
|
||||||
self.assertTrue(num_children_after == num_children_before - 1)
|
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():
|
def test_main():
|
||||||
run_unittest(MinidomTest)
|
run_unittest(MinidomTest)
|
||||||
|
|
||||||
|
|
|
@ -976,7 +976,7 @@ class ProcessingInstruction(Childless, Node):
|
||||||
def _get_nodeValue(self):
|
def _get_nodeValue(self):
|
||||||
return self.data
|
return self.data
|
||||||
def _set_nodeValue(self, value):
|
def _set_nodeValue(self, value):
|
||||||
self.data = data
|
self.data = value
|
||||||
nodeValue = property(_get_nodeValue, _set_nodeValue)
|
nodeValue = property(_get_nodeValue, _set_nodeValue)
|
||||||
|
|
||||||
# nodeName is an alias for target
|
# nodeName is an alias for target
|
||||||
|
|
Loading…
Reference in New Issue