diff options
Diffstat (limited to 'Lib/asyncio/futures.py')
-rw-r--r-- | Lib/asyncio/futures.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index 74a99ba03c..d06828a620 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -19,6 +19,7 @@ _CANCELLED = 'CANCELLED' _FINISHED = 'FINISHED' _PY34 = sys.version_info >= (3, 4) +_PY35 = sys.version_info >= (3, 5) Error = concurrent.futures._base.Error CancelledError = concurrent.futures.CancelledError @@ -387,6 +388,9 @@ class Future: assert self.done(), "yield from wasn't used with future" return self.result() # May raise too. + if _PY35: + __await__ = __iter__ # make compatible with 'await' expression + def wrap_future(fut, *, loop=None): """Wrap concurrent.futures.Future object.""" |