Commit c2a4c00b authored by Denis Bilenko's avatar Denis Bilenko

socket: fix wait() to use Hub.wait()

parent 7e5973a9
......@@ -143,12 +143,7 @@ def wait(io, timeout=None, timeout_exc=timeout('timed out')):
if timeout is not None:
timeout = Timeout.start_new(timeout, timeout_exc)
try:
io.start(getcurrent().switch)
try:
result, _revents = get_hub().switch()
assert io is result, 'Invalid switch into wait(%r): %r' % ((result, _revents), )
finally:
io.stop()
return get_hub().wait(io)
finally:
if timeout is not None:
timeout.cancel()
......
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