diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 10:46:09 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 10:46:09 (GMT) |
| commit | 3bc13cc8b0b85f989b8da9c5718fc5319ad06248 (patch) | |
| tree | 52fc5995a7cc1ccafce61ef403b7dea1a4ff342d /Lib/asyncio/tasks.py | |
| parent | 667abc7d42e87b87338981276d0eac9895d4abf4 (diff) | |
| parent | e50dafcd636ba32db890600164698bb070d40d97 (diff) | |
| download | cpython-3bc13cc8b0b85f989b8da9c5718fc5319ad06248.zip cpython-3bc13cc8b0b85f989b8da9c5718fc5319ad06248.tar.gz cpython-3bc13cc8b0b85f989b8da9c5718fc5319ad06248.tar.bz2 | |
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 dd191e7..8c7217b 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: |
