Skip to content

Commit 8ae506e

Browse files
committed
Missing part of for etree treewalker to report the end tag of the root node
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40993
1 parent af96a74 commit 8ae506e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/html5lib/treewalkers/etree.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ def getNextSibling(self, node):
101101
return None
102102

103103
def getParentNode(self, node):
104-
assert isinstance(node, tuple)
105-
elt, key, parents = node
106-
if parents:
107-
elt, key = parents.pop()
108-
return elt, key, parents
104+
if isinstance(node, tuple):
105+
elt, key, parents = node
106+
if parents:
107+
elt, key = parents.pop()
108+
return elt, key, parents
109+
else:
110+
return elt
109111
else:
110-
return elt
112+
return None
111113

112114
return locals()

0 commit comments

Comments
 (0)