From 65dd745f1a343dd80f5e612736f36200631f2840 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 14 Nov 2022 16:21:40 +0100 Subject: gh-99300: Use Py_NewRef() in Modules/ directory (#99473) Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory. --- Modules/symtablemodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Modules/symtablemodule.c') diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index c25ecc2b5d..4ef1d8cde0 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -56,8 +56,7 @@ _symtable_symtable_impl(PyObject *module, PyObject *source, if (st == NULL) { return NULL; } - t = (PyObject *)st->st_top; - Py_INCREF(t); + t = Py_NewRef(st->st_top); _PySymtable_Free(st); return t; } -- cgit v1.2.1