asyncio_slow: Fix wait: again, should not schedule anything itself.

pull/11/head
Paul Sokolovsky 2014-05-02 02:52:59 +03:00
rodzic 0b1d9a0493
commit 3949d4f8b6
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -115,7 +115,7 @@ def async(coro):
return Task(coro)
class Wait(Future):
class _Wait(Future):
def __init__(self, n):
Future.__init__(self)
@ -133,12 +133,11 @@ class Wait(Future):
def wait(coro_list, loop=_def_event_loop):
w = Wait(len(coro_list))
w = _Wait(len(coro_list))
for c in coro_list:
t = async(c)
t.add_done_callback(lambda val: w._done())
loop.call_soon(t)
return w