Skip to content

Conversation

@Locked-chess-official
Copy link
Contributor

@Locked-chess-official Locked-chess-official commented Jan 27, 2026

@Locked-chess-official
Copy link
Contributor Author

I will check which cause the SyntaxWarning to SyntaxError.

This is on my computer:

image

check_awaitable(compiler* c, expr_ty e)
{
/* Emit a warning when awaiting obvious non-awaitable literal objects. */
switch (e->kind) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to swap the kinds and only consider kinds that are awaitable. Otherwise, we need to update that list whenever we add a new kind that is not awaitable.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a What's New entry, and tests as well.

@@ -0,0 +1 @@
SyntaxWarning when await an unawaitable constant.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires better phrasing. This does not explain anything.

@bedevere-app
Copy link

bedevere-app bot commented Jan 27, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixz picnixz marked this pull request as draft January 27, 2026 12:47
@picnixz
Copy link
Member

picnixz commented Jan 27, 2026

Since the PR is not ready I'm going to put it as a draft for now.

@Locked-chess-official
Copy link
Contributor Author

I take a day but fail to find what upgrade "SyntaxWarning" to "SyntaxError".
cc@vstinner Can you work out what happened in test? This is the most important problem.

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.

2 participants