Skip to content

Commit 3c9fc21

Browse files
committed
Only apply hack for bug in minidom when using minidom.
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401099
1 parent 8755eb6 commit 3c9fc21

File tree

1 file changed

+2
-1
lines changed
  • src/html5lib/treebuilders

1 file changed

+2
-1
lines changed

src/html5lib/treebuilders/dom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def insertDoctype(self, name, publicId, systemId):
9494
domimpl = Dom.getDOMImplementation()
9595
doctype = domimpl.createDocumentType(name, publicId, systemId)
9696
self.document.appendChild(NodeBuilder(doctype))
97-
doctype.ownerDocument = self.dom
97+
if Dom == minidom:
98+
doctype.ownerDocument = self.dom
9899

99100
def elementClass(self, name):
100101
return NodeBuilder(self.dom.createElement(name))

0 commit comments

Comments
 (0)