Unwrap one-element exception tuple in except

Proprietary

A tuple containing only one exception type is needlessly verbose. This unwraps it to the plain except ExcType: form where the element is a name or dotted name. A tuple holding a comment or a starred element is left alone.

org.openrewrite.python.cleanup.SimplifySingleExceptionTuple
mod run . --recipe=org.openrewrite.python.cleanup.SimplifySingleExceptionTuple

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.