mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
This commit is contained in:
parent
19c1462e8d
commit
8211cf5d28
18 changed files with 40 additions and 74 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue