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

Configuration file:

[MAIN]
py-version=3.7

Additional details:

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

Created by the basic checker.