aboutsummaryrefslogtreecommitdiff
path: root/Lib/html
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-02-13 20:20:00 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2012-02-13 20:20:00 +0200
commite31ddedb0e5d0151cd4d7821365690ba9d22386d (patch)
treedb74da80a177aff004f17943855f165ba268a93f /Lib/html
parentshutil copy module reference doc fix. (diff)
downloadcpython-e31ddedb0e5d0151cd4d7821365690ba9d22386d.tar.gz
cpython-e31ddedb0e5d0151cd4d7821365690ba9d22386d.tar.bz2
cpython-e31ddedb0e5d0151cd4d7821365690ba9d22386d.zip
Fix an index and clean up comments.
Diffstat (limited to 'Lib/html')
-rw-r--r--Lib/html/parser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 9db8ab582be..aa31fbc5b1b 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -270,12 +270,13 @@ class HTMLParser(_markupbase.ParserBase):
if rawdata[i:i+2] != '<!':
self.error('unexpected call to parse_html_declaration()')
if rawdata[i:i+4] == '<!--':
+ # this case is actually already handled in goahead()
return self.parse_comment(i)
elif rawdata[i:i+3] == '<![':
return self.parse_marked_section(i)
elif rawdata[i:i+9].lower() == '<!doctype':
# find the closing >
- gtpos = rawdata.find('>', 9)
+ gtpos = rawdata.find('>', i+9)
if gtpos == -1:
return -1
self.handle_decl(rawdata[i+2:gtpos])