mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -2163,8 +2163,7 @@ _tkinter_tkapp_splitlist(TkappObject *self, PyObject *arg)
|
|||
for (i = 0; i < argc; i++) {
|
||||
PyObject *s = unicodeFromTclString(argv[i]);
|
||||
if (!s) {
|
||||
Py_DECREF(v);
|
||||
v = NULL;
|
||||
Py_SETREF(v, NULL);
|
||||
goto finally;
|
||||
}
|
||||
PyTuple_SET_ITEM(v, i, s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue