Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 9ced405..6b0e3c6 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -228,7 +228,7 @@
node = node->next;
}
- Py_XSETREF(self->statement_cache,
+ Py_SETREF(self->statement_cache,
(pysqlite_Cache *)PyObject_CallFunction((PyObject *)&pysqlite_CacheType, "O", self));
Py_DECREF(self);
self->statement_cache->decref_factory = 0;
@@ -815,7 +815,7 @@
}
}
- Py_XSETREF(self->statements, new_list);
+ Py_SETREF(self->statements, new_list);
}
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
@@ -846,7 +846,7 @@
}
}
- Py_XSETREF(self->cursors, new_list);
+ Py_SETREF(self->cursors, new_list);
}
PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index b3ec8f2..f2b48ff 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -544,7 +544,7 @@
/* reset description and rowcount */
Py_INCREF(Py_None);
- Py_XSETREF(self->description, Py_None);
+ Py_SETREF(self->description, Py_None);
self->rowcount = -1L;
func_args = PyTuple_New(1);
@@ -569,7 +569,7 @@
}
if (self->statement->in_use) {
- Py_XSETREF(self->statement,
+ Py_SETREF(self->statement,
PyObject_New(pysqlite_Statement, &pysqlite_StatementType));
if (!self->statement) {
goto error;
@@ -681,7 +681,7 @@
numcols = sqlite3_column_count(self->statement->st);
Py_END_ALLOW_THREADS
- Py_XSETREF(self->description, PyTuple_New(numcols));
+ Py_SETREF(self->description, PyTuple_New(numcols));
if (!self->description) {
goto error;
}