continue-in-finally / E0116#

Message emitted:

'continue' not supported inside 'finally' clause

Description:

Emitted when the `continue` keyword is found inside a finally clause, which is a SyntaxError.

Problematic code:

while True:
    try:
        pass
    finally:
        continue  # [continue-in-finally]

Correct code:

while True:
    try:
        pass
    except ValueError:
        pass
    else:
        continue

Additional details:

Note this message can't be emitted when using Python version 3.8 or greater.

Created by the basic checker.