summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-12-06 04:32:18 (GMT)
committerFred Drake <fdrake@acm.org>2001-12-06 04:32:18 (GMT)
commite50959a58ef4f365295f0393cb980de890c0024a (patch)
treedab611a240b38d3b88d5c8df21839fa06eb5f7cb /Lib/xml/dom
parentbf7c8045887c0f97698b5ce80a28ddbae40c957e (diff)
downloadcpython-e50959a58ef4f365295f0393cb980de890c0024a.zip
cpython-e50959a58ef4f365295f0393cb980de890c0024a.tar.gz
cpython-e50959a58ef4f365295f0393cb980de890c0024a.tar.bz2
Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node. This closes SF bug #487929.
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/minidom.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 5b26da7..2e9d866 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -132,7 +132,7 @@ class Node(xml.dom.Node):
def insertBefore(self, newChild, refChild):
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
- for c in newChild.childNodes:
+ for c in tuple(newChild.childNodes):
self.insertBefore(c, refChild)
### The DOM does not clearly specify what to return in this case
return newChild
@@ -160,7 +160,7 @@ class Node(xml.dom.Node):
def appendChild(self, node):
if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
- for c in node.childNodes:
+ for c in tuple(node.childNodes):
self.appendChild(c)
### The DOM does not clearly specify what to return in this case
return node