#17802: Fix an UnboundLocalError in html.parser. Initial tests by Thomas Barlow.

This commit is contained in:
Ezio Melotti 2013-05-01 16:18:25 +03:00
parent a771a1b48e
commit 8e596a765c
3 changed files with 18 additions and 0 deletions

View file

@ -249,6 +249,7 @@ class HTMLParser(_markupbase.ParserBase):
if self.strict:
self.error("EOF in middle of entity or char ref")
else:
k = match.end()
if k <= i:
k = n
i = self.updatepos(i, i + 1)