-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
'await' in non-async function is a blocking error, fixes #15339 #15384
Conversation
…nt' for test cases and the error print in mypy/message_registry.py
…pe comment' for test cases and the error print in mypy/message_registry.py" This reverts commit 6080839.
…or in type comment' for test cases and the error print in mypy/message_registry.py"" This reverts commit f468fbb.
…d syntax'" This reverts commit ce7f920.
…'syntax error'->'Syntax error' change. Currently only Syntax error has been changed from the main branch
…in an ASYNC function definition
for more information, see https://pre-commit.ci
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Looks like the docs build is failing on It's because there are no docs for the new |
I am curious why the build didn't fail on the PR, and failed only after merge on master. |
Because it was an old PR, that predated the new docs check, and |
OK, I see. @hauntsaninja @gregorysantosa Could you please add the docs for the new error code to unbreak master? |
Fixed in #15858 |
Sorry for not replying to this, I took a break from the internet for a while. I will be more active here from here on out! Thank you. |
Fixes, #15339
Added a new error code AWAIT_NOT_ASYNC to address awaits in non-async functions as a blocking error. Then I assigned the error code to an error print in visit_await_expr and removed the blocker flag.
I modified the testInvalidComprehensionNoCrash test case within the check-async-await.test file to reflect the updated error message for await statements not located within async functions.