summaryrefslogtreecommitdiffstats
path: root/Modules/_cursesmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-14 12:08:15 (GMT)
committerGitHub <noreply@github.com>2022-11-14 12:08:15 (GMT)
commit3817607b8a345851e4fa436747a346890ced33f1 (patch)
treebe135083ae53cef88b2187a5470cff46c68110ef /Modules/_cursesmodule.c
parentdb115682bd639a2642c617f0b7d5b30cd7d7f472 (diff)
downloadcpython-3817607b8a345851e4fa436747a346890ced33f1.zip
cpython-3817607b8a345851e4fa436747a346890ced33f1.tar.gz
cpython-3817607b8a345851e4fa436747a346890ced33f1.tar.bz2
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.
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r--Modules/_cursesmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 0ddd6dc..5146b40 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);