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