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

Skip to content

Commit e31dded

Browse files
committed
Fix an index and clean up comments.
1 parent 7f728c1 commit e31dded

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/html/parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ def parse_html_declaration(self, i):
270270
if rawdata[i:i+2] != '<!':
271271
self.error('unexpected call to parse_html_declaration()')
272272
if rawdata[i:i+4] == '<!--':
273+
# this case is actually already handled in goahead()
273274
return self.parse_comment(i)
274275
elif rawdata[i:i+3] == '<![':
275276
return self.parse_marked_section(i)
276277
elif rawdata[i:i+9].lower() == '<!doctype':
277278
# find the closing >
278-
gtpos = rawdata.find('>', 9)
279+
gtpos = rawdata.find('>', i+9)
279280
if gtpos == -1:
280281
return -1
281282
self.handle_decl(rawdata[i+2:gtpos])

Lib/test/test_htmlparser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ def test_declaration_junk_chars(self):
393393
self._run_check("<!DOCTYPE foo $ >", [('decl', 'DOCTYPE foo $ ')])
394394

395395
def test_illegal_declarations(self):
396-
# XXX this might be wrong
397396
self._run_check('<!spacer type="block" height="25">',
398397
[('comment', 'spacer type="block" height="25"')])
399398

0 commit comments

Comments
 (0)