mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -326,8 +326,8 @@ w_ref(PyObject *v, char *flag, WFILE *p)
|
|||
goto err;
|
||||
}
|
||||
w = (int)s;
|
||||
Py_INCREF(v);
|
||||
if (_Py_hashtable_set(p->hashtable, v, (void *)(uintptr_t)w) < 0) {
|
||||
if (_Py_hashtable_set(p->hashtable, Py_NewRef(v),
|
||||
(void *)(uintptr_t)w) < 0) {
|
||||
Py_DECREF(v);
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue