Skip to content

Commit bf696f4

Browse files
committed
Fixed input stream regexp cache
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401156
1 parent 313c7b0 commit bf696f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/html5lib/inputstream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ def charsUntil(self, characters, opposite = False):
308308

309309
# Use a cache of regexps to find the required characters
310310
try:
311-
chars = charsUntilRegEx[characters]
311+
chars = charsUntilRegEx[(characters, opposite)]
312312
except KeyError:
313313
for c in characters: assert(ord(c) < 128)
314314
regex = u"".join("\\x%02x" % ord(c) for c in characters)
315315
if not opposite:
316316
regex = u"^%s" % regex
317-
chars = charsUntilRegEx[characters] = re.compile(u"[%s]*" % regex)
317+
chars = charsUntilRegEx[(characters, opposite)] = re.compile(u"[%s]*" % regex)
318318

319319
while True:
320320
# Find the longest matching prefix

0 commit comments

Comments
 (0)