Skip to content

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

Merged
1st1 merged 3 commits into
python:masterfrom
zsol:async-statements
Apr 27, 2018
Merged

bpo-33363: raise SyntaxError for async for/with outside async functions#6616
1st1 merged 3 commits into
python:masterfrom
zsol:async-statements

Conversation

@zsol

@zsol zsol commented Apr 27, 2018

Copy link
Copy Markdown
Member

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

https://bugs.python.org/issue33363

Comment thread Python/compile.c
{
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
Copy Markdown
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

1st1 commented Apr 27, 2018

Copy link
Copy Markdown
Member

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

@zsol

zsol commented Apr 27, 2018

Copy link
Copy Markdown
Member Author

Thanks for the review!

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

Copy link
Copy Markdown

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

@miss-islington

Copy link
Copy Markdown
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
Copy Markdown
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

1st1 commented Apr 27, 2018

Copy link
Copy Markdown
Member

Thanks for the PR and opening the issue, Zsolt!

@1st1

1st1 commented Apr 27, 2018

Copy link
Copy Markdown
Member

@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 <zsol.zsol@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

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.

5 participants