Issue39965
Created on 2020-03-15 03:50 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 19010 | merged | pablogsal, 2020-03-15 03:59 | |
| PR 19011 | merged | miss-islington, 2020-03-15 04:29 | |
| Messages (4) | |||
|---|---|---|---|
| msg364216 - (view) | Author: Pablo Galindo Salgado (pablogsal) * | Date: 2020-03-15 03:50 | |
If PyCF_ALLOW_TOP_LEVEL_AWAIT is set this code is valid: def f(): await foo And this should raise a "SyntaxError: 'await' outside async function". The reason is that the PyCF_ALLOW_TOP_LEVEL_AWAIT is global in the compiler and affects everything without checking if the current code being compiled is actually in the TOP level or not. |
|||
| msg364217 - (view) | Author: Pablo Galindo Salgado (pablogsal) * | Date: 2020-03-15 04:29 | |
New changeset 90235810ec28ca954bbf4b61a5ae5df7a00db409 by Pablo Galindo in branch 'master': bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010) https://github.com/python/cpython/commit/90235810ec28ca954bbf4b61a5ae5df7a00db409 |
|||
| msg364218 - (view) | Author: miss-islington (miss-islington) | Date: 2020-03-15 04:46 | |
New changeset f7e32fcbd65490c921e1836c2399827d14d0eb7b by Miss Islington (bot) in branch '3.8': bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010) https://github.com/python/cpython/commit/f7e32fcbd65490c921e1836c2399827d14d0eb7b |
|||
| msg364221 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2020-03-15 06:00 | |
Good catch & PR ;) Thanks |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:28 | admin | set | github: 84146 |
| 2020-03-15 06:00:32 | yselivanov | set | messages: + msg364221 |
| 2020-03-15 04:46:30 | miss-islington | set | messages: + msg364218 |
| 2020-03-15 04:30:29 | pablogsal | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-03-15 04:29:49 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request18358 |
| 2020-03-15 04:29:39 | pablogsal | set | messages: + msg364217 |
| 2020-03-15 03:59:05 | pablogsal | set | keywords:
+ patch stage: patch review pull_requests: + pull_request18356 |
| 2020-03-15 03:58:24 | BTaskaya | set | nosy:
+ BTaskaya |
| 2020-03-15 03:50:53 | pablogsal | create | |