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