diff options
author | Shantanu <12621235+hauntsaninja@users.noreply.github.com> | 2022-08-12 19:03:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 19:03:44 (GMT) |
commit | a92c2d6eb55a64881b978cfc4b531dad3d14984b (patch) | |
tree | d91845c151b6c992773082d749e08727b7def465 /Grammar | |
parent | 44bf05ed0cea7f9ddc0713daed38d9bb2f35c981 (diff) | |
download | cpython-a92c2d6eb55a64881b978cfc4b531dad3d14984b.zip cpython-a92c2d6eb55a64881b978cfc4b531dad3d14984b.tar.gz cpython-a92c2d6eb55a64881b978cfc4b531dad3d14984b.tar.bz2 |
[3.10] gh-94996: Disallow parsing pos only params with feature_version < (3, 8) (GH-95935)
(cherry picked from commit https://github.com/python/cpython/commit/b5e3ea286289fcad12be78480daf3756e350f69f)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Automerge-Triggered-By: GH:lysnikolaou
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/python.gram | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 7570748..dcba7ad 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -427,9 +427,9 @@ params[arguments_ty]: parameters[arguments_ty]: | a=slash_no_default b[asdl_arg_seq*]=param_no_default* c=param_with_default* d=[star_etc] { - _PyPegen_make_arguments(p, a, NULL, b, c, d) } + CHECK_VERSION(arguments_ty, 8, "Positional-only parameters are", _PyPegen_make_arguments(p, a, NULL, b, c, d)) } | a=slash_with_default b=param_with_default* c=[star_etc] { - _PyPegen_make_arguments(p, NULL, a, NULL, b, c) } + CHECK_VERSION(arguments_ty, 8, "Positional-only parameters are", _PyPegen_make_arguments(p, NULL, a, NULL, b, c)) } | a[asdl_arg_seq*]=param_no_default+ b=param_with_default* c=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, a, b, c) } | a=param_with_default+ b=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)} |