diff options
| author | Yury Selivanov <yselivanov@sprymix.com> | 2015-11-05 14:29:19 -0500 |
|---|---|---|
| committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-11-05 14:29:19 -0500 |
| commit | 7931be403d6f616777e4a46cf43ee0bd21374889 (patch) | |
| tree | 5b8fe11e1318321768f5dac0a644244a9609efc2 /Lib/asyncio/tasks.py | |
| parent | b5d0a215536c0b5b7d100f54aad9968b4760122c (diff) | |
| parent | ade0412613f7628e34d947168cd5f447fa6b8f17 (diff) | |
| download | cpython-git-7931be403d6f616777e4a46cf43ee0bd21374889.tar.gz | |
Merge 3.4
Diffstat (limited to 'Lib/asyncio/tasks.py')
| -rw-r--r-- | Lib/asyncio/tasks.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index b887d88934..77a93e0fe0 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -488,6 +488,10 @@ def as_completed(fs, *, loop=None, timeout=None): @coroutine def sleep(delay, result=None, *, loop=None): """Coroutine that completes after a given time (in seconds).""" + if delay == 0: + yield + return result + future = futures.Future(loop=loop) h = future._loop.call_later(delay, future._set_result_unless_cancelled, result) |
