Commit 92287c85 authored by Ron Rothman's avatar Ron Rothman Committed by Jason Madden

fixed semaphore return value logic

parent 7f9fedfa
......@@ -742,9 +742,10 @@ class Pool(Group):
Added the ``blocking`` and ```timeout`` parameters.
"""
if not self._semaphore.acquire(blocking=blocking, timeout=timeout):
# We failed to acquire the semaphore. Presumably, blocking was False, because had it
# been True, we would have either acquired the semaphore or encountered a Timeout.
raise Full
# 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 Full()
try:
Group.add(self, greenlet)
......
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