diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-10 08:03:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 08:03:39 (GMT) |
commit | d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20 (patch) | |
tree | 7055b2d966bf41e636751177cea0248b56072e92 /Python/ast_opt.c | |
parent | f883b7f8ee3209b52863fc662343c8cd81abdc59 (diff) | |
download | cpython-d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20.zip cpython-d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20.tar.gz cpython-d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20.tar.bz2 |
gh-99300: Use Py_NewRef() in Python/ directory (#99302)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in C files of the Python/ directory.
Diffstat (limited to 'Python/ast_opt.c')
-rw-r--r-- | Python/ast_opt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 426c534..1a0b2a0 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -533,8 +533,7 @@ make_const_tuple(asdl_expr_seq *elts) for (int i = 0; i < asdl_seq_LEN(elts); i++) { expr_ty e = (expr_ty)asdl_seq_GET(elts, i); PyObject *v = e->v.Constant.value; - Py_INCREF(v); - PyTuple_SET_ITEM(newval, i, v); + PyTuple_SET_ITEM(newval, i, Py_NewRef(v)); } return newval; } |