summaryrefslogtreecommitdiffstats
path: root/Parser/string_parser.c
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 /Parser/string_parser.c
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 'Parser/string_parser.c')
-rw-r--r--Parser/string_parser.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index e13272c..c096bea 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -417,9 +417,7 @@ fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end,
PyMem_Free(str);
return NULL;
}
- Py_INCREF(p->tok->filename);
-
- tok->filename = p->tok->filename;
+ tok->filename = Py_NewRef(p->tok->filename);
tok->lineno = t->lineno + lines - 1;
Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, p->feature_version,