[Python-checkins] CVS: python/dist/src/Lib/xml/dom minidom.py,1.41,1.42
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 05 Dec 2001 20:32:20 -0800
Update of /cvsroot/python/python/dist/src/Lib/xml/dom
In directory usw-pr-cvs1:/tmp/cvs-serv17611/xml/dom
Modified Files:
minidom.py
Log Message:
Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node.
This closes SF bug #487929.
Index: minidom.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/minidom.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** minidom.py 2001/11/30 22:21:58 1.41
--- minidom.py 2001/12/06 04:32:18 1.42
***************
*** 133,137 ****
def insertBefore(self, newChild, refChild):
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
! for c in newChild.childNodes:
self.insertBefore(c, refChild)
### The DOM does not clearly specify what to return in this case
--- 133,137 ----
def insertBefore(self, newChild, refChild):
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
! for c in tuple(newChild.childNodes):
self.insertBefore(c, refChild)
### The DOM does not clearly specify what to return in this case
***************
*** 161,165 ****
def appendChild(self, node):
if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
! for c in node.childNodes:
self.appendChild(c)
### The DOM does not clearly specify what to return in this case
--- 161,165 ----
def appendChild(self, node):
if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
! for c in tuple(node.childNodes):
self.appendChild(c)
### The DOM does not clearly specify what to return in this case