mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Added fix for possible bug in re.finditer.
This commit is contained in:
parent
9f24c13be8
commit
bbbc97c11b
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user