diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 13:46:09 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 13:46:09 +0300 |
commit | 3bc13cc8b0b85f989b8da9c5718fc5319ad06248 (patch) | |
tree | 52fc5995a7cc1ccafce61ef403b7dea1a4ff342d /Lib/asyncio/tasks.py | |
parent | 667abc7d42e87b87338981276d0eac9895d4abf4 (diff) | |
parent | e50dafcd636ba32db890600164698bb070d40d97 (diff) | |
download | cpython-git-3bc13cc8b0b85f989b8da9c5718fc5319ad06248.tar.gz |
Merge heads
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r-- | Lib/asyncio/tasks.py | 3 |
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: |