← All recipes
Moderne licensed

Replace re.template() with re.compile() and flag re.TEMPLATE/re.T

Recipe IDorg.openrewrite.python.migrate.ReplaceReTemplateArtifactopenrewrite-migrate-python

re.template() was deprecated in Python 3.11 and removed in 3.13. Calls are auto-replaced with re.compile(). re.TEMPLATE/re.T flags have no direct replacement and are flagged for manual review.

Single recipepythonremigration3.11Proprietary

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.ReplaceReTemplate

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

mod config recipes pip install openrewrite-migrate-python