Commit 28cba07d authored by Ron Rothman's avatar Ron Rothman Committed by Jason Madden

raise PoolFull, not Timeout

parent d4b00714
......@@ -734,8 +734,8 @@ class Pool(Group):
:keyword float timeout: The maximum number of seconds this method will
block, if ``blocking`` is True. (Ignored if ``blocking`` is False.)
Raises ``Timeout`` on timeout, or `PoolFull` if ``blocking`` is False and
the pool is full.
Raises `PoolFull` if either ``blocking`` is False and the pool was full,
or if ``blocking`` is True and ``timeout`` was exceeded.
.. seealso:: :meth:`Group.add`
......@@ -745,8 +745,8 @@ class Pool(Group):
if not self._semaphore.acquire(blocking=blocking, timeout=timeout):
# We failed to acquire the semaphore.
# If blocking was True, then there was a timeout. If blocking was
# False, then there was no capacity.
raise Timeout() if blocking else PoolFull()
# False, then there was no capacity. Either way, raise PoolFull.
raise PoolFull()
try:
Group.add(self, greenlet)
......
......@@ -226,7 +226,7 @@ class PoolBasicTests(greentest.TestCase):
second = gevent.spawn(gevent.sleep, 1000)
try:
p.add(first)
with self.assertRaises(Timeout):
with self.assertRaises(pool.PoolFull):
p.add(second, timeout=0.100)
finally:
second.kill()
......
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