10000 Fix last beautifulsoup treewalker test -- comment nodes or doctypes c… · awesome-python/html5lib-python@a4b4d0d · GitHub
[go: up one dir, main page]

Skip to content

Commit a4b4d0d

Browse files
committed
Fix last beautifulsoup treewalker test -- comment nodes or doctypes can have empty values which evaluate to false
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40699
1 parent 555d383 commit a4b4d0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/treewalkers/_base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ def __iter__(self):
126126
else:
127127
yield self.unknown(details[0])
128128

129-
firstChild = hasChildren and self.getFirstChild(currentNode) or None
129+
if hasChildren:
130+
firstChild = self.getFirstChild(currentNode)
131+
else:
132+
firstChild = None
133+
130134
if firstChild is not None:
131135
currentNode = firstChild
132136
else:

0 commit comments

Comments
 (0)
0