mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
1e197e63e2
commit
4ce2a202c7
4 changed files with 5 additions and 11 deletions
|
@ -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>");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue