'await' in non-async function is a blocking error, fixes #15339#15384
'await' in non-async function is a blocking error, fixes #15339#15384hauntsaninja merged 12 commits intopython:masterfrom
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. ✅ |
hauntsaninja
left a comment
There was a problem hiding this comment.
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.