bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)

The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is.


https://bugs.python.org/issue36921
This commit is contained in:
Andrew Svetlov 2019-05-16 17:52:10 +03:00 committed by Miss Islington (bot)
parent dbacfc2273
commit 68b34a7204
12 changed files with 311 additions and 320 deletions

View file

@ -588,8 +588,7 @@ class StreamTests(test_utils.TestCase):
stream = asyncio.StreamReader(loop=self.loop,
_asyncio_internal=True)
@asyncio.coroutine
def set_err():
async def set_err():
stream.set_exception(ValueError())
t1 = asyncio.Task(stream.readline(), loop=self.loop)