Closed
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 :)