]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45421: Remove dead code from html.parser (GH-28847)
authorAlberto Mardegan <mardy@users.sourceforge.net>
Tue, 12 Oct 2021 17:12:21 +0000 (20:12 +0300)
committerGitHub <noreply@github.com>
Tue, 12 Oct 2021 17:12:21 +0000 (10:12 -0700)
Support for HtmlParserError was removed back in 2014 with commit
73a4359eb0eb624c588c5d52083ea4944f9787ea, however this small block was
missed.

Lib/html/parser.py

index 58f6bb3b1e932dbfa0081662eae1c54bb7ec918b..bef0f4fe4bf776c34aac57ab9bbbce6d3ab238f5 100644 (file)
@@ -328,13 +328,6 @@ class HTMLParser(_markupbase.ParserBase):
 
         end = rawdata[k:endpos].strip()
         if end not in (">", "/>"):
-            lineno, offset = self.getpos()
-            if "\n" in self.__starttag_text:
-                lineno = lineno + self.__starttag_text.count("\n")
-                offset = len(self.__starttag_text) \
-                         - self.__starttag_text.rfind("\n")
-            else:
-                offset = offset + len(self.__starttag_text)
             self.handle_data(rawdata[i:endpos])
             return endpos
         if end.endswith('/>'):