← All recipes
Moderne licensed

Replace pkgutil.find_loader() with importlib.util.find_spec()

Recipe IDorg.openrewrite.python.migrate.ReplacePkgutilFindLoaderArtifactopenrewrite-migrate-python

The pkgutil.find_loader() function was deprecated in Python 3.12. Replace with importlib.util.find_spec(). Note: returns ModuleSpec, use .loader for loader.

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

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

mod config recipes pip install openrewrite-migrate-python