Commit a5c82704 authored by Denis Bilenko's avatar Denis Bilenko

Fix for issue #39 (Semaphore.acquire should return False when timeout expires). Patch by Teh Ekik.

parent 42a9ae9c
......@@ -110,8 +110,9 @@ class Semaphore(object):
result = get_hub().switch()
assert result is self, 'Invalid switch into Semaphore.acquire(): %r' % (result, )
except Timeout, ex:
if ex is not timer:
raise
if ex is timer:
return False
raise
finally:
timer.cancel()
finally:
......
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