mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
This commit is contained in:
parent
e0805cf10e
commit
57a01d3a0e
20 changed files with 52 additions and 42 deletions
|
@ -1943,7 +1943,7 @@ element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value)
|
|||
|
||||
if (strcmp(name, "tag") == 0) {
|
||||
Py_INCREF(value);
|
||||
Py_XSETREF(self->tag, value);
|
||||
Py_SETREF(self->tag, value);
|
||||
} else if (strcmp(name, "text") == 0) {
|
||||
Py_DECREF(JOIN_OBJ(self->text));
|
||||
self->text = value;
|
||||
|
@ -1958,7 +1958,7 @@ element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value)
|
|||
return -1;
|
||||
}
|
||||
Py_INCREF(value);
|
||||
Py_XSETREF(self->extra->attrib, value);
|
||||
Py_SETREF(self->extra->attrib, value);
|
||||
} else {
|
||||
PyErr_SetString(PyExc_AttributeError,
|
||||
"Can't set arbitrary attributes on Element");
|
||||
|
@ -2551,9 +2551,9 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
|
|||
self->index++;
|
||||
|
||||
Py_INCREF(node);
|
||||
Py_XSETREF(self->this, node);
|
||||
Py_SETREF(self->this, node);
|
||||
Py_INCREF(node);
|
||||
Py_XSETREF(self->last, node);
|
||||
Py_SETREF(self->last, node);
|
||||
|
||||
if (treebuilder_append_event(self, self->start_event_obj, node) < 0)
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue