Skip to content
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

DeprecationWarning: "@coroutine" decorator is deprecated #276

Open
ylassoued opened this issue Mar 24, 2022 · 3 comments
Open

DeprecationWarning: "@coroutine" decorator is deprecated #276

ylassoued opened this issue Mar 24, 2022 · 3 comments

Comments

@ylassoued
Copy link

ylassoued commented Mar 24, 2022

Module cached_property.py, function wrapper, declared in line 42, uses decorator @asyncio.coroutine.
It seems that the asyncio @coroutine decorator is deprecated since Python 3.8.
Please use async def instead.
Source code should be modified to look like:

    def _wrap_in_coroutine(self, obj):
        @wraps(obj)
        async def wrapper():
            future = asyncio.ensure_future(self.func(obj))
            obj.__dict__[self.func.__name__] = future
            return future

        return wrapper()
@encukou
Copy link

encukou commented Sep 14, 2022

See #267

@ylassoued
Copy link
Author

Thank you @encukou! But does this mean that the issue is now resolved in cached_property.py?

@encukou
Copy link

encukou commented Sep 14, 2022

No, it would need to be merged & released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants