From: Paul Prescod Date: Fri, 15 Sep 2000 17:09:19 +0000 (+0000) Subject: Fixed bug that disallowed processing instructions before and after X-Git-Tag: v2.0b2~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce88db02303409ae8b19f8aaf5e540c2f99f47c1;p=thirdparty%2FPython%2Fcpython.git Fixed bug that disallowed processing instructions before and after document element. --- diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 3f5668ed7787..18d82eed6f1b 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -396,10 +396,11 @@ class Document( Node ): self.nodeValue=None def appendChild( self, node ): - if node.nodeType==Node.ELEMENT_NODE and self.documentElement: - raise TypeError, "Two document elements disallowed" - else: - self.documentElement=node + if node.nodeType==Node.ELEMENT_NODE: + if self.documentElement: + raise TypeError, "Two document elements disallowed" + else: + self.documentElement=node Node.appendChild( self, node ) return node