From 70adad2a0e7bfb2fbe70027acfb85230dc790b0b Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Sun, 31 May 2015 21:37:09 -0400 Subject: [PATCH] Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutines --- Lib/asyncio/coroutines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index 4933cf83d26..edb68062107 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -120,7 +120,7 @@ class CoroWrapper: __await__ = __iter__ # make compatible with 'await' expression def __next__(self): - return next(self.gen) + return self.gen.send(None) if _YIELD_FROM_BUG: # For for CPython issue #21209: using "yield from" and a custom