summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-05-14 15:50:11 (GMT)
committerFred Drake <fdrake@acm.org>2002-05-14 15:50:11 (GMT)
commit30d59baecd3c01c851ddaf5b206938d663446971 (patch)
tree5b03626124c3135293707264616d75a52e87d54a /Lib
parent570764ddce285afc32e6bd4bce031e421376b382 (diff)
downloadcpython-30d59baecd3c01c851ddaf5b206938d663446971.zip
cpython-30d59baecd3c01c851ddaf5b206938d663446971.tar.gz
cpython-30d59baecd3c01c851ddaf5b206938d663446971.tar.bz2
Simplify code to remove an unnecessary test.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/HTMLParser.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/HTMLParser.py b/Lib/HTMLParser.py
index bd6a885..908b30e 100644
--- a/Lib/HTMLParser.py
+++ b/Lib/HTMLParser.py
@@ -148,8 +148,6 @@ class HTMLParser(markupbase.ParserBase):
k = self.parse_starttag(i)
elif startswith("</", i):
k = self.parse_endtag(i)
- if k >= 0:
- self.clear_cdata_mode()
elif startswith("<!--", i):
k = self.parse_comment(i)
elif startswith("<?", i):
@@ -329,6 +327,7 @@ class HTMLParser(markupbase.ParserBase):
self.error("bad end tag: %s" % `rawdata[i:j]`)
tag = match.group(1)
self.handle_endtag(tag.lower())
+ self.clear_cdata_mode()
return j
# Overridable -- finish processing of start+end tag: <tag.../>