Commit 3fd5de56 authored by Denis Bilenko's avatar Denis Bilenko

hub: improve readability

parent 0761c44c
......@@ -66,12 +66,12 @@ def sleep(seconds=0):
expressing a cooperative yield.
"""
unique_mark = object()
t = core.timer(seconds, getcurrent().switch, unique_mark)
timer = core.timer(seconds, getcurrent().switch, unique_mark)
try:
switch_result = get_hub().switch()
assert switch_result is unique_mark, 'Invalid switch into sleep(): %r' % (switch_result, )
except:
t.cancel()
timer.cancel()
raise
......
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