Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kpinc opened this issue Oct 3, 2024 · 1 comment

Comments

@kpinc
Copy link

kpinc commented Oct 3, 2024

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

@asottile
Copy link
Member

asottile commented Oct 3, 2024

this is a partial dupe of #461 -- should be easy to fix if you'd like to make an attempt at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants