mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
|
|
@ -885,8 +885,7 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena
|
|||
tok->fp_interactive = 1;
|
||||
}
|
||||
// This transfers the ownership to the tokenizer
|
||||
tok->filename = filename_ob;
|
||||
Py_INCREF(filename_ob);
|
||||
tok->filename = Py_NewRef(filename_ob);
|
||||
|
||||
// From here on we need to clean up even if there's an error
|
||||
mod_ty result = NULL;
|
||||
|
|
@ -925,8 +924,7 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen
|
|||
return NULL;
|
||||
}
|
||||
// This transfers the ownership to the tokenizer
|
||||
tok->filename = filename_ob;
|
||||
Py_INCREF(filename_ob);
|
||||
tok->filename = Py_NewRef(filename_ob);
|
||||
|
||||
// We need to clear up from here on
|
||||
mod_ty result = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue