Added fix for possible bug in re.finditer.

This commit is contained in:
Jeremy Fincher 2003-10-04 09:59:06 +00:00
parent 9f24c13be8
commit bbbc97c11b

View File

@ -686,7 +686,13 @@ class PrivmsgRegexp(Privmsg):
return return
fed = False fed = False
for (r, method) in self.res: for (r, method) in self.res:
spans = sets.Set()
for m in r.finditer(msg.args[1]): for m in r.finditer(msg.args[1]):
# There's a bug in finditer: http://www.python.org/sf/817234
if m.span() in spans:
break
else:
spans.add(m.span())
if not fed: if not fed:
fed = True fed = True
self.rateLimiter.put(msg) self.rateLimiter.put(msg)