-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
PEP654 introduced exception groups and except*
in python3.11
Link: https://peps.python.org/pep-0654/
Right now it is possible to parse except*
with older ast.parse(..., feature_version=(3, 10))
.
Example:
>>> import ast
>>> code = '''
... try:
... ...
... except* Exception:
... ...
... '''
>>>
>>> ast.parse(code)
<ast.Module object at 0x10c685410>
>>> ast.parse(code, feature_version=(3, 8))
<ast.Module object at 0x10c685280>
>>>
Which is not correct.
But, unlike #96427 it is very simple to fix. And I belive it should be fixed.
I've already applied a patch and will send it shortly after :)
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error