pyflakes icon indicating copy to clipboard operation
pyflakes copied to clipboard

Use of await in a function that is not async should be shown as a syntax error by flake8

Open kpinc opened this issue 4 months ago • 1 comments

Hello,

Reporting here, since flake8 seems to want this sort of problem delegated to you.

The following code uses await in a function that is declared without the async keyword, which is a syntax error.

def foo():
    pass


def bar():
    await foo()

Running flake8 on this succeeds, no error is reported.

flake8 --version 7.1.1 (mccabe: 0.7.0, pycodestyle: 2.12.1, pyflakes: 3.2.0) CPython 3.11.2 on Linux Debian 12.7 pyflakes 3.2.0 installed in a virtual environment

kpinc avatar Oct 03 '24 17:10 kpinc