Skip to content

Commit 4822712

Browse files
committed
Get rid of more frozenset calls around constants
1 parent b6a6484 commit 4822712

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

html5lib/html5parser.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def mainLoop(self):
209209
currentNodeNamespace == defaultNamespace or
210210
(self.isMathMLTextIntegrationPoint(currentNode) and
211211
((type == StartTagToken and
212-
token["name"] not in frozenset(["mglyph", "malignmark"])) or
212+
token["name"] not in ("mglyph", "malignmark")) or
213213
type in (CharactersToken, SpaceCharactersToken))) or
214214
(currentNodeNamespace == namespaces["mathml"] and
215215
currentNodeName == "annotation-xml" and
@@ -1301,11 +1301,11 @@ def endTagBody(self, token):
13011301
return
13021302
elif self.tree.openElements[-1].name != "body":
13031303
for node in self.tree.openElements[2:]:
1304-
if node.name not in frozenset(("dd", "dt", "li", "optgroup",
1305-
"option", "p", "rp", "rt",
1306-
"tbody", "td", "tfoot",
1307-
"th", "thead", "tr", "body",
1308-
"html")):
1304+
if node.name not in ("dd", "dt", "li", "optgroup",
1305+
"option", "p", "rp", "rt",
1306+
"tbody", "td", "tfoot",
1307+
"th", "thead", "tr", "body",
1308+
"html"):
13091309
# Not sure this is the correct name for the parse error
13101310
self.parser.parseError(
13111311
"expected-one-end-tag-but-got-another",
@@ -1517,7 +1517,7 @@ def endTagFormatting(self, token):
15171517
if lastNode.parent:
15181518
lastNode.parent.removeChild(lastNode)
15191519

1520-
if commonAncestor.name in frozenset(("table", "tbody", "tfoot", "thead", "tr")):
1520+
if commonAncestor.name in ("table", "tbody", "tfoot", "thead", "tr"):
15211521
parent, insertBefore = self.tree.getTableMisnestedNodePosition()
15221522
parent.insertBefore(lastNode, insertBefore)
15231523
else:

html5lib/treebuilders/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def getTableMisnestedNodePosition(self):
390390
def generateImpliedEndTags(self, exclude=None):
391391
name = self.openElements[-1].name
392392
# XXX td, th and tr are not actually needed
393-
if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt")) and
393+
if (name in ("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt") and
394394
name != exclude):
395395
self.openElements.pop()
396396
# XXX This is not entirely what the specification says. We should

0 commit comments

Comments
 (0)