diff options
author | Matthew Rahtz <matthew.rahtz@gmail.com> | 2022-03-26 16:55:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 16:55:35 (GMT) |
commit | e8e737bcf6d22927caebc30c5d57ac4634063219 (patch) | |
tree | 6c0d4d51e8216f02fa0e6874aa4d78e20dd9397a /Python/ast_unparse.c | |
parent | 26cca8067bf5306e372c0e90036d832c5021fd90 (diff) | |
download | cpython-e8e737bcf6d22927caebc30c5d57ac4634063219.zip cpython-e8e737bcf6d22927caebc30c5d57ac4634063219.tar.gz cpython-e8e737bcf6d22927caebc30c5d57ac4634063219.tar.bz2 |
bpo-43224: Implement PEP 646 grammar changes (GH-31018)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Python/ast_unparse.c')
-rw-r--r-- | Python/ast_unparse.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index f148e99..6565b6b 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -786,19 +786,8 @@ static int append_ast_subscript(_PyUnicodeWriter *writer, expr_ty e) { APPEND_EXPR(e->v.Subscript.value, PR_ATOM); - int level = PR_TUPLE; - expr_ty slice = e->v.Subscript.slice; - if (slice->kind == Tuple_kind) { - for (Py_ssize_t i = 0; i < asdl_seq_LEN(slice->v.Tuple.elts); i++) { - expr_ty element = asdl_seq_GET(slice->v.Tuple.elts, i); - if (element->kind == Starred_kind) { - ++level; - break; - } - } - } APPEND_STR("["); - APPEND_EXPR(e->v.Subscript.slice, level); + APPEND_EXPR(e->v.Subscript.slice, PR_TUPLE); APPEND_STR_FINISH("]"); } |