gh-95813: Improve HTMLParser from the view of inheritance (#95874)

* gh-95813: Improve HTMLParser from the view of inheritance

* gh-95813: Add unittest

* Address code review
This commit is contained in:
Dong-hee Na 2022-08-18 20:16:33 +09:00 committed by GitHub
parent c5bc67b2a1
commit 157aef79b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -89,6 +89,7 @@ class HTMLParser(_markupbase.ParserBase):
If convert_charrefs is True (the default), all character references
are automatically converted to the corresponding Unicode characters.
"""
super().__init__()
self.convert_charrefs = convert_charrefs
self.reset()
@ -98,7 +99,7 @@ class HTMLParser(_markupbase.ParserBase):
self.lasttag = '???'
self.interesting = interesting_normal
self.cdata_elem = None
_markupbase.ParserBase.reset(self)
super().reset()
def feed(self, data):
r"""Feed data to the parser.