From 8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 16 Nov 2022 18:34:24 +0100 Subject: gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530) Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef(). --- Python/import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index c12b3e07b5..ab42672108 100644 --- a/Python/import.c +++ b/Python/import.c @@ -625,8 +625,7 @@ import_add_module(PyThreadState *tstate, PyObject *name) PyObject *m; if (PyDict_CheckExact(modules)) { - m = PyDict_GetItemWithError(modules, name); - Py_XINCREF(m); + m = Py_XNewRef(PyDict_GetItemWithError(modules, name)); } else { m = PyObject_GetItem(modules, name); -- cgit v1.2.1