diff options
author | Shantanu <12621235+hauntsaninja@users.noreply.github.com> | 2022-08-12 17:27:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 17:27:50 (GMT) |
commit | b5e3ea286289fcad12be78480daf3756e350f69f (patch) | |
tree | cbe1dd02a951509837c0136cfc78d9f0f0332931 /Parser/parser.c | |
parent | d2373fcb498888e3faa47747a57791f0ed82c91e (diff) | |
download | cpython-b5e3ea286289fcad12be78480daf3756e350f69f.zip cpython-b5e3ea286289fcad12be78480daf3756e350f69f.tar.gz cpython-b5e3ea286289fcad12be78480daf3756e350f69f.tar.bz2 |
gh-94996: Disallow parsing pos only params with feature_version < (3, 8) (GH-94997)
Diffstat (limited to 'Parser/parser.c')
-rw-r--r-- | Parser/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Parser/parser.c b/Parser/parser.c index f4082ab..15e833a 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -4637,7 +4637,7 @@ parameters_rule(Parser *p) ) { D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?")); - _res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); + _res = CHECK_VERSION ( arguments_ty , 8 , "Positional-only parameters are" , _PyPegen_make_arguments ( p , a , NULL , b , c , d ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; p->level--; @@ -4667,7 +4667,7 @@ parameters_rule(Parser *p) ) { D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default param_with_default* star_etc?")); - _res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); + _res = CHECK_VERSION ( arguments_ty , 8 , "Positional-only parameters are" , _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; p->level--; |