Commit 303e79a4 authored by Denis Bilenko's avatar Denis Bilenko

make the code compatible with python2.4

parent 9bb9f16c
......@@ -92,17 +92,18 @@ class GreenletSet(object):
def kill(self, exception=GreenletExit, block=True, timeout=None):
timer = Timeout.start_new(timeout)
try:
while self.greenlets:
for greenlet in list(self.greenlets):
if greenlet not in self.dying:
greenlet.kill(exception, block=False)
self.dying.add(greenlet)
if not block:
break
joinall(self.greenlets)
except Timeout, ex:
if ex is not timer:
raise
try:
while self.greenlets:
for greenlet in list(self.greenlets):
if greenlet not in self.dying:
greenlet.kill(exception, block=False)
self.dying.add(greenlet)
if not block:
break
joinall(self.greenlets)
except Timeout, ex:
if ex is not timer:
raise
finally:
timer.cancel()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment