summaryrefslogtreecommitdiff
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-11-05 14:29:19 -0500
committerYury Selivanov <yselivanov@sprymix.com>2015-11-05 14:29:19 -0500
commit7931be403d6f616777e4a46cf43ee0bd21374889 (patch)
tree5b8fe11e1318321768f5dac0a644244a9609efc2 /Lib/asyncio/tasks.py
parentb5d0a215536c0b5b7d100f54aad9968b4760122c (diff)
parentade0412613f7628e34d947168cd5f447fa6b8f17 (diff)
downloadcpython-git-7931be403d6f616777e4a46cf43ee0bd21374889.tar.gz
Merge 3.4
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py4
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)