diff options
Diffstat (limited to 'Lib/asyncio/coroutines.py')
-rw-r--r-- | Lib/asyncio/coroutines.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index c665ebe..9664ea7 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -7,6 +7,7 @@ import os import sys import traceback import types +import warnings from . import base_futures from . import constants @@ -107,6 +108,9 @@ def coroutine(func): If the coroutine is not yielded from before it is destroyed, an error message is logged. """ + warnings.warn('"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead', + DeprecationWarning, + stacklevel=2) if inspect.iscoroutinefunction(func): # In Python 3.5 that's all we need to do for coroutines # defined with "async def". |