diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-11-13 13:54:04 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-11-13 13:54:04 +0100 |
commit | 7f4921d2395bf3ee6764a7799c883d566863667f (patch) | |
tree | f1a12fd88378bef733081cec51823c31e35510c9 | |
parent | 6cba83b9b7cfa3b5195c04aa59d4cc77c2d2510f (diff) | |
download | trollius-7f4921d2395bf3ee6764a7799c883d566863667f.tar.gz |
Task._step() now calls directly create_task()
Call lop.create_task() instead of using the helper function async().
-rw-r--r-- | trollius/tasks.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/trollius/tasks.py b/trollius/tasks.py index ab5c226..892bb7c 100644 --- a/trollius/tasks.py +++ b/trollius/tasks.py @@ -284,7 +284,9 @@ class Task(futures.Future): result = result.obj if iscoroutine(result): - result = async(result, loop=self._loop) + # "yield coroutine" creates a task, the current task + # will wait until the new task is done + result = self._loop.create_task(result) # FIXME: faster check. common base class? hasattr? elif isinstance(result, (Lock, Condition, Semaphore)): coro = _lock_coroutine(result) |