Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30d59ba

Browse files
committed
Simplify code to remove an unnecessary test.
1 parent 570764d commit 30d59ba

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/HTMLParser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ def goahead(self, end):
148148
k = self.parse_starttag(i)
149149
elif startswith("</", i):
150150
k = self.parse_endtag(i)
151-
if k >= 0:
152-
self.clear_cdata_mode()
153151
elif startswith("<!--", i):
154152
k = self.parse_comment(i)
155153
elif startswith("<?", i):
@@ -329,6 +327,7 @@ def parse_endtag(self, i):
329327
self.error("bad end tag: %s" % `rawdata[i:j]`)
330328
tag = match.group(1)
331329
self.handle_endtag(tag.lower())
330+
self.clear_cdata_mode()
332331
return j
333332

334333
# Overridable -- finish processing of start+end tag: <tag.../>

0 commit comments

Comments
 (0)