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.
This commit is contained in:
Victor Stinner 2022-11-10 15:30:05 +01:00 committed by GitHub
parent 1e197e63e2
commit 4ce2a202c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 11 deletions

View file

@ -2223,8 +2223,7 @@ _PyTokenizer_FindEncodingFilename(int fd, PyObject *filename)
return NULL;
}
if (filename != NULL) {
Py_INCREF(filename);
tok->filename = filename;
tok->filename = Py_NewRef(filename);
}
else {
tok->filename = PyUnicode_FromString("<string>");