mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
|
|
@ -341,8 +341,7 @@ _PyGen_yf(PyGenObject *gen)
|
|||
/* Not in a yield from */
|
||||
return NULL;
|
||||
}
|
||||
yf = _PyFrame_StackPeek(frame);
|
||||
Py_INCREF(yf);
|
||||
yf = Py_NewRef(_PyFrame_StackPeek(frame));
|
||||
}
|
||||
|
||||
return yf;
|
||||
|
|
@ -494,8 +493,7 @@ throw_here:
|
|||
/* Normalize to raise <class>, <instance> */
|
||||
Py_XDECREF(val);
|
||||
val = typ;
|
||||
typ = PyExceptionInstance_Class(typ);
|
||||
Py_INCREF(typ);
|
||||
typ = Py_NewRef(PyExceptionInstance_Class(typ));
|
||||
|
||||
if (tb == NULL)
|
||||
/* Returns NULL if there's no traceback */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue