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

bpo-33363: raise SyntaxError for async for/with outside async functions #6616

Merged
merged 3 commits into from
Apr 27, 2018

Conversation

zsol
Copy link
Contributor

@zsol zsol commented Apr 27, 2018

This is still caught only at the compile phase (in python 3.6 it's caught even earlier).

https://bugs.python.org/issue33363

Python/compile.c Outdated
@@ -2443,6 +2443,9 @@ static int
compiler_async_for(struct compiler *c, stmt_ty s)
{
basicblock *start, *except, *end;
if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION)
return compiler_error(c, "'async for' outside async function");
Copy link
Member

Choose a reason for hiding this comment

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

Please add { per pep 7

@1st1
Copy link
Member

1st1 commented Apr 27, 2018

Also need a NEWS entry. Please use blurb to generate it.

@zsol
Copy link
Contributor Author

zsol commented Apr 27, 2018

Thanks for the review!

@1st1 1st1 merged commit e239650 into python:master Apr 27, 2018
@bedevere-bot
Copy link

@1st1: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @zsol for the PR, and @1st1 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @zsol and @1st1, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker e2396506606115e785c94ec129eb86e2ed0aa744 3.7

@1st1
Copy link
Member

1st1 commented Apr 27, 2018

Thanks for the PR and opening the issue, Zsolt!

@1st1
Copy link
Member

1st1 commented Apr 27, 2018

@zsol Can you submit a separate PR against 3.7?

zsol added a commit to zsol/cpython that referenced this pull request Apr 27, 2018
zsol added a commit to zsol/cpython that referenced this pull request Apr 27, 2018
…unctions (pythonGH-6616).

(cherry picked from commit e239650)

Co-authored-by: Zsolt Dollenstein <[email protected]>
@bedevere-bot
Copy link

GH-6619 is a backport of this pull request to the 3.7 branch.

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.

None yet

5 participants