diff options
-rw-r--r-- | Lib/xml/dom/minidom.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 3f5668e..18d82ee 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 |