[3.11] gh-96587: Raise SyntaxError for PEP654 on older feature_version (GH-96588) (#96591)

(cherry picked from commit 2c7d2e8d46)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Nikita Sobolev 2022-10-06 01:00:13 +03:00 committed by GitHub
parent a8d50aeada
commit 8c6ced36ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 2 deletions

2
Parser/parser.c generated
View file

@ -6970,7 +6970,7 @@ try_stmt_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
_res = _PyAST_TryStar ( b , ex , el , f , EXTRA );
_res = CHECK_VERSION ( stmt_ty , 11 , "Exception groups are" , _PyAST_TryStar ( b , ex , el , f , EXTRA ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;