Skip to content

Commit abf1605

Browse files
committed
Restored Python 2.3 compatibility. Fixed typo of "certain".
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401160
1 parent 980e9ad commit abf1605

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/html5lib/inputstream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
4545
# List of where new lines occur
4646
self.newLines = [0]
4747

48-
self.charEncoding = (encoding, "certian")
48+
self.charEncoding = (encoding, "certain")
4949

5050
# Raw Stream - for unicode objects this will encode to utf-8 and set
5151
# self.charEncoding as appropriate
@@ -92,7 +92,7 @@ def openStream(self, source):
9292
# Otherwise treat source as a string and convert to a file object
9393
if isinstance(source, unicode):
9494
source = source.encode('utf-8')
95-
self.charEncoding = ("utf-8", "certian")
95+
self.charEncoding = ("utf-8", "certain")
9696
import cStringIO
9797
stream = cStringIO.StringIO(str(source))
9898
return stream
@@ -316,7 +316,7 @@ def charsUntil(self, characters, opposite = False):
316316
chars = charsUntilRegEx[(characters, opposite)]
317317
except KeyError:
318318
for c in characters: assert(ord(c) < 128)
319-
regex = u"".join("\\x%02x" % ord(c) for c in characters)
319+
regex = u"".join(["\\x%02x" % ord(c) for c in characters])
320320
if not opposite:
321321
regex = u"^%s" % regex
322322
chars = charsUntilRegEx[(characters, opposite)] = re.compile(u"[%s]*" % regex)

0 commit comments

Comments
 (0)