diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2019-08-25 14:41:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-25 14:41:47 (GMT) |
commit | 6ca030765db49525f16b8fabff4153238148b58d (patch) | |
tree | 4b6455f79bbaa35b2fa260226545208aa3cfac4e /PC | |
parent | 970548c00b366dcb8eb0c2bec0ffcab30ba03aee (diff) | |
download | cpython-6ca030765db49525f16b8fabff4153238148b58d.zip cpython-6ca030765db49525f16b8fabff4153238148b58d.tar.gz cpython-6ca030765db49525f16b8fabff4153238148b58d.tar.bz2 |
[3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491)
- drop TargetScopeError in favour of raising SyntaxError directly
as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
named expression targets in comprehensions are nonlocal or
global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
comprehension have an ambiguous target scope. Avoid resolving
that question now by raising SyntaxError. PEP 572
originally required this only for cases where the bound name
conflicts with the iteration variable in the comprehension,
but CPython can't easily restrict the exception to that case
(as it doesn't know the target variable names when visiting
the outermost iterator expression)
(cherry picked from commit 5dbe0f59b7a4f39c7c606b48056bc29e406ebf78)
Diffstat (limited to 'PC')
-rw-r--r-- | PC/python3.def | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/PC/python3.def b/PC/python3.def index e317864..5d93c18 100644 --- a/PC/python3.def +++ b/PC/python3.def @@ -235,7 +235,6 @@ EXPORTS PyExc_SystemError=python38.PyExc_SystemError DATA PyExc_SystemExit=python38.PyExc_SystemExit DATA PyExc_TabError=python38.PyExc_TabError DATA - PyExc_TargetScopeError=python38.PyExc_TargetScopeError DATA PyExc_TimeoutError=python38.PyExc_TimeoutError DATA PyExc_TypeError=python38.PyExc_TypeError DATA PyExc_UnboundLocalError=python38.PyExc_UnboundLocalError DATA |