Replace re.template() with re.compile() and flag re.TEMPLATE/re.T
Proprietaryre.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.
org. openrewrite. python. migrate. ReplaceReTemplatemod run . --recipe= org. openrewrite. python. migrate. ReplaceReTemplateInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Change import
- Find
re.TEMPLATEandre.T