From 3949d4f8b61275e6151be815ee135107ddbb1ec5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 2 May 2014 02:52:59 +0300 Subject: [PATCH] asyncio_slow: Fix wait: again, should not schedule anything itself. --- asyncio_slow/asyncio_slow.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/asyncio_slow/asyncio_slow.py b/asyncio_slow/asyncio_slow.py index e82afcf1..55f1347f 100644 --- a/asyncio_slow/asyncio_slow.py +++ b/asyncio_slow/asyncio_slow.py @@ -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