Commit 2b8b548a authored by Denis Bilenko's avatar Denis Bilenko

pool.Pool.join(): fix timeout bug: it used to raise Timeout instead of simply returning

parent 39a98e2a
......@@ -72,12 +72,16 @@ class GreenletSet(object):
# self.add = RaiseException("This %s has been closed" % self.__class__.__name__)
def join(self, timeout=None, raise_error=False):
t = Timeout.start_new(timeout)
timeout = Timeout.start_new(timeout)
try:
while self.greenlets:
joinall(self.greenlets, raise_error=raise_error)
try:
while self.greenlets:
joinall(self.greenlets, raise_error=raise_error)
except Timeout, ex:
if ex is not timeout:
raise
finally:
t.cancel()
timeout.cancel()
def kill(self, exception=GreenletExit, block=False, timeout=None):
t = Timeout.start_new(timeout)
......
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