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

'await' in non-async function is a blocking error, fixes #15339 #15384

Merged
merged 12 commits into from
Aug 12, 2023

Conversation

gregorysantosa
Copy link
Contributor

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.

@gregorysantosa gregorysantosa changed the title 'await' in non-async function is a blocking error, refs #15339 'await' in non-async function is a blocking error, fixes #15339 Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@hauntsaninja hauntsaninja left a 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!

@AlexWaygood
Copy link
Member

AlexWaygood commented Aug 12, 2023

Looks like the docs build is failing on master as a result of this change: https://github.com/python/mypy/actions/runs/5840508131/job/15839825549

It's because there are no docs for the new await-not-async error code

@ilevkivskyi
Copy link
Member

I am curious why the build didn't fail on the PR, and failed only after merge on master.

@AlexWaygood
Copy link
Member

AlexWaygood commented Aug 12, 2023

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 master had not been merged into the PR branch since the new docs check had been introduced

@ilevkivskyi
Copy link
Member

OK, I see. @hauntsaninja @gregorysantosa Could you please add the docs for the new error code to unbreak master?

@hauntsaninja
Copy link
Collaborator

Fixed in #15858

@gregorysantosa
Copy link
Contributor Author

gregorysantosa commented Oct 14, 2023

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.

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

Successfully merging this pull request may close these issues.

4 participants