Catch and rethrow exception
Catching and re-throwing an exception without further actions is redundant and wasteful. Instead, it is recommended to re-throw custom exception type and/or log trace for debugging.
def nested_noncompliant():
    try:
        try_something()
    except KeyError as e:
        try:
            catch_and_try_something()
        # Noncompliant: unnecessary `except` clause.
        except ValueError:
            raise
        raise e
def nested_compliant():
    try:
        try_something()
    except KeyError as e:
        try:
            catch_and_try_something()
        except ValueError:
            # Compliant: operation in `except` clause.
            rethrow_exception_something()
            raise
        raise e