summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-10 14:30:05 (GMT)
committerGitHub <noreply@github.com>2022-11-10 14:30:05 (GMT)
commit4ce2a202c7b573edaa0ee4a2315d5578f66737c5 (patch)
tree306b0a880ccfd96f3953d507fd7d23822c478462 /Tools
parent1e197e63e21f77b102ff2601a549dda4b6439455 (diff)
downloadcpython-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.c3
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;