mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
This commit is contained in:
parent
5d9183c7ad
commit
81f7359f67
22 changed files with 44 additions and 87 deletions
|
@ -37,8 +37,7 @@ _PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value,
|
|||
if (traceback != NULL && !PyTraceBack_Check(traceback)) {
|
||||
/* XXX Should never happen -- fatal error instead? */
|
||||
/* Well, it could be None. */
|
||||
Py_DECREF(traceback);
|
||||
traceback = NULL;
|
||||
Py_SETREF(traceback, NULL);
|
||||
}
|
||||
|
||||
/* Save these in locals to safeguard against recursive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue