8000 gh-121637: Syntax error for optimized-away incorrect await by JelleZijlstra · Pull Request #121656 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-121637: Syntax error for optimized-away incorrect await #121656

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

Merged
merged 10 commits into from
Jul 22, 2024
Prev Previous commit
Next Next commit
not not no but no
  • Loading branch information
JelleZijlstra committed Jul 13, 2024
commit 07d5488c0238ab9344c4b47de6609b8f1d819d43
2 changes: 1 addition & 1 deletion Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
st->st_cur->ste_type == FunctionBlock &&
st->st_cur->ste_coroutine
);
if (!is_async_def && st->st_cur->ste_comprehension != NoComprehension) {
if (!is_async_def && st->st_cur->ste_comprehension == NoComprehension) {
PyErr_SetString(PyExc_SyntaxError,
"'await' outside async function");
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
Expand Down
Loading
0