summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/futures.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2017-12-11 15:35:49 (GMT)
committerGitHub <noreply@github.com>2017-12-11 15:35:49 (GMT)
commit8874342cf332c3aa3d845155cc4b41b00c2d9e9d (patch)
tree79b2b2a3413fde605670e995428e64144a509f77 /Lib/asyncio/futures.py
parentabae67ebc2897ca37df067f322d19e19d1ef6d88 (diff)
downloadcpython-8874342cf332c3aa3d845155cc4b41b00c2d9e9d.zip
cpython-8874342cf332c3aa3d845155cc4b41b00c2d9e9d.tar.gz
cpython-8874342cf332c3aa3d845155cc4b41b00c2d9e9d.tar.bz2
bpo-32258: Replace 'yield from' to 'await' in asyncio docs (#4779)
* Replace 'yield from' to 'await' in asyncio docs * Fix docstrings
Diffstat (limited to 'Lib/asyncio/futures.py')
-rw-r--r--Lib/asyncio/futures.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index b805f99..d46a295 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -59,7 +59,8 @@ class Future:
# The value must also be not-None, to enable a subclass to declare
# that it is not compatible by setting this to None.
# - It is set by __iter__() below so that Task._step() can tell
- # the difference between `yield from Future()` (correct) vs.
+ # the difference between
+ # `await Future()` or`yield from Future()` (correct) vs.
# `yield Future()` (incorrect).
_asyncio_future_blocking = False
@@ -236,7 +237,7 @@ class Future:
if not self.done():
self._asyncio_future_blocking = True
yield self # This tells Task to wait for completion.
- assert self.done(), "yield from wasn't used with future"
+ assert self.done(), "await wasn't used with future"
return self.result() # May raise too.
__await__ = __iter__ # make compatible with 'await' expression