Skip to content

DeprecationWarning: "@coroutine" decorator is deprecated #276

@ylassoued

Description

@ylassoued

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions