summaryrefslogtreecommitdiff
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-07 13:46:09 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-07 13:46:09 +0300
commit3bc13cc8b0b85f989b8da9c5718fc5319ad06248 (patch)
tree52fc5995a7cc1ccafce61ef403b7dea1a4ff342d /Lib/asyncio/tasks.py
parent667abc7d42e87b87338981276d0eac9895d4abf4 (diff)
parente50dafcd636ba32db890600164698bb070d40d97 (diff)
downloadcpython-git-3bc13cc8b0b85f989b8da9c5718fc5319ad06248.tar.gz
Merge heads
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index dd191e770b..8c7217b702 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -487,7 +487,8 @@ def as_completed(fs, *, loop=None, timeout=None):
def sleep(delay, result=None, *, loop=None):
"""Coroutine that completes after a given time (in seconds)."""
future = futures.Future(loop=loop)
- h = future._loop.call_later(delay, future.set_result, result)
+ h = future._loop.call_later(delay,
+ future._set_result_unless_cancelled, result)
try:
return (yield from future)
finally: