summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPaul Prescod <prescod@prescod.net>2000-09-15 17:09:19 (GMT)
committerPaul Prescod <prescod@prescod.net>2000-09-15 17:09:19 (GMT)
commitce88db02303409ae8b19f8aaf5e540c2f99f47c1 (patch)
tree91370de72b92c6338e91257b57593ee860a03fba /Lib
parent8999053326a8e7a3e6e8d2ca70810fec19804096 (diff)
downloadcpython-ce88db02303409ae8b19f8aaf5e540c2f99f47c1.zip
cpython-ce88db02303409ae8b19f8aaf5e540c2f99f47c1.tar.gz
cpython-ce88db02303409ae8b19f8aaf5e540c2f99f47c1.tar.bz2
Fixed bug that disallowed processing instructions before and after
document element.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/xml/dom/minidom.py9
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