Skip to content

False positive on continue in finally block (Python 3.8) #3612

Closed
@ethan-leba

Description

@ethan-leba

Steps to reproduce

Run pylint on the follow code:

for i in range(3):
    try:
        raise Exception()
    except Exception:
        pass
    finally:
        continue

Current behavior

Produces error: E0116: 'continue' not supported inside 'finally' clause (continue-in-finally)

Expected behavior

https://docs.python.org/3/whatsnew/3.8.html
As of Python 3.8, the above code will no longer throw a SyntaxError, so no error should be produced.

pylint --version output

pylint 2.5.2
astroid 2.4.1
Python 3.8.2 (default, Mar 11 2020, 00:29:30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions