From 3817607b8a345851e4fa436747a346890ced33f1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 14 Nov 2022 13:08:15 +0100 Subject: gh-99300: Use Py_NewRef() in Modules/ directory (#99466) Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory. --- Modules/_cursesmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Modules/_cursesmodule.c') diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 0ddd6dc764..5146b4004a 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -389,8 +389,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj, #endif } else if (PyBytes_Check(obj)) { - Py_INCREF(obj); - *bytes = obj; + *bytes = Py_NewRef(obj); /* check for embedded null bytes */ if (PyBytes_AsStringAndSize(*bytes, &str, NULL) < 0) { Py_DECREF(obj); -- cgit v1.2.1