-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation: @coroutine" decorator is deprecated since Python 3.8, use "async def" instead. #4842
Comments
This seems to be implemented through the
stdin:
|
It looks like |
The def coroutine(fn: Callable) -> Callable:
""" Decorator to convert a regular function to a coroutine function.
Since asyncio.coroutine is set to be removed in 3.10, this allows
awaiting a regular function. Not useful as a @-based decorator,
but very helpful for inline conversions of unknown functions, and
especially lambdas.
"""
if iscoroutinefunction(fn):
return fn
@wraps(fn)
async def _wrapper(*args, **kwargs):
return fn(*args, **kwargs)
return _wrapper |
The problematic code here ( It would be good to have a 3.6.x release which includes a fix for this (since the fix is very easy, replace |
In the meantime, if you use # pytest.ini
[pytest]
filterwarnings =
ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning
|
Related to #4477 |
Fixed on master and 3.7 |
Bumps [intake-geopandas](https://github.com/intake/intake_geopandas) from 0.2.3 to 0.2.3+40.ge08c8. - [Release notes](https://github.com/intake/intake_geopandas/releases) - [Commits](intake/intake_geopandas@0.2.3...e08c89b) Also bumped aiohttp from 3.6.2 to 3.7.2 to silence a DeprecationWarning (see aio-libs/aiohttp#4842).
🐞 Describe the bug
Use of aiohttp issuing deprecation warnings for python 3.8 and will result in error in 3.10.
Apparently, changing do
async def
has no negative impact on the user.💡 To Reproduce
Call any function that is decorated by
@coroutine
.For example
aiohttp/helpers.py:107
💡 Expected behavior
Get a deprecation warning:
📋 Logs/tracebacks
📋 Your version of the Python
📋 Your version of the aiohttp/yarl/multidict distributions
The text was updated successfully, but these errors were encountered: