mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
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.
This commit is contained in:
parent
db115682bd
commit
3817607b8a
10 changed files with 106 additions and 214 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue