← All recipes
Moderne licensed

Migrate @asyncio.coroutine to async def

Recipe IDorg.openrewrite.python.migrate.MigrateAsyncioCoroutineArtifactopenrewrite-migrate-python

Migrate functions using the deprecated @asyncio.coroutine decorator to use async def syntax. Also transforms yield from to await. The decorator was removed in Python 3.11.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.migrate.MigrateAsyncioCoroutine

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python