diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-10 14:30:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 14:30:05 (GMT) |
commit | 4ce2a202c7b573edaa0ee4a2315d5578f66737c5 (patch) | |
tree | 306b0a880ccfd96f3953d507fd7d23822c478462 /Tools | |
parent | 1e197e63e21f77b102ff2601a549dda4b6439455 (diff) | |
download | cpython-4ce2a202c7b573edaa0ee4a2315d5578f66737c5.zip cpython-4ce2a202c7b573edaa0ee4a2315d5578f66737c5.tar.gz cpython-4ce2a202c7b573edaa0ee4a2315d5578f66737c5.tar.bz2 |
gh-99300: Use Py_NewRef() in Parser/ directory (#99330)
Replace Py_INCREF() with Py_NewRef() in C files of the Parser/
directory and in the PEG generator.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/peg_generator/peg_extension/peg_extension.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index 3ebb7bd..7df134b 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -12,8 +12,7 @@ _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *ar } else if (mode == 1) { result = PyAST_mod2obj(module); } else { - result = Py_None; - Py_INCREF(result); + result = Py_NewRef(Py_None); } return result; |