[Python-checkins] cpython (merge 3.4 -> default): merge
raymond.hettinger
python-checkins at python.org
Sun Jun 15 23:50:48 CEST 2014
http://hg.python.org/cpython/rev/d1d677516e49
changeset: 91188:d1d677516e49
parent: 91186:4b0775631ebb
parent: 91187:ca33faa214ab
user: Raymond Hettinger <python at rcn.com>
date: Sun Jun 15 14:50:39 2014 -0700
summary:
merge
files:
Lib/test/test_minidom.py | 7 +++++++
Lib/xml/dom/minidom.py | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1531,6 +1531,13 @@
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)
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -976,7 +976,7 @@
def _get_nodeValue(self):
return self.data
def _set_nodeValue(self, value):
- self.data = data
+ self.data = value
nodeValue = property(_get_nodeValue, _set_nodeValue)
# nodeName is an alias for target
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list