A bare ``++raise++`` statement, i.e. a ``++raise++`` with no exception provided, will re-raise the last active exception in the current scope. If no exception is active a ``++RuntimeError++`` is raised instead.
If the bare "raise" statement is in a ``++finally++`` block, it will only have an active exception to re-raise when an exception from the ``++try++`` block is not caught or when an exception is raised by an ``++except++`` or ``++else++`` block. Thus bare ``++raise++`` statements should not be relied upon in ``++finally++`` blocks. It is simpler to let the exception raise automatically.
This rule raises an issue when a bare ``++raise++`` statements is in a ``++finally++`` block.
=== on 29 Jan 2020, 13:56:33 Nicolas Harraudeau wrote:
This rule is similar toRSPEC-1163but the problem is a little different. It is perfectly ok to raise an exception in a ``++finally++`` block in python. Python will automatically link the new exception to any exception raised in the ``++try++`` block. However a bare ``++raise++`` is problematic as it can fail.