← All recipes
Moderne licensed

Unwrap one-element exception tuple in except

Recipe IDorg.openrewrite.python.cleanup.SimplifySingleExceptionTupleArtifactopenrewrite-static-analysis

A tuple containing only one exception type is needlessly verbose. This unwraps it to the plain except ExcType: form.

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.cleanup.SimplifySingleExceptionTuple

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

mod config recipes pip install openrewrite-static-analysis