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
|
@ -204,7 +204,7 @@ void pysqlite_flush_statement_cache(pysqlite_Connection* self)
|
|||
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;
|
||||
|
@ -794,7 +794,7 @@ static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self
|
|||
}
|
||||
}
|
||||
|
||||
Py_XSETREF(self->statements, new_list);
|
||||
Py_SETREF(self->statements, new_list);
|
||||
}
|
||||
|
||||
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
|
||||
|
@ -825,7 +825,7 @@ static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
|
|||
}
|
||||
}
|
||||
|
||||
Py_XSETREF(self->cursors, new_list);
|
||||
Py_SETREF(self->cursors, new_list);
|
||||
}
|
||||
|
||||
PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
|
||||
|
|
|
@ -510,7 +510,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
|
||||
/* 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);
|
||||
|
@ -535,7 +535,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
}
|
||||
|
||||
if (self->statement->in_use) {
|
||||
Py_XSETREF(self->statement,
|
||||
Py_SETREF(self->statement,
|
||||
PyObject_New(pysqlite_Statement, &pysqlite_StatementType));
|
||||
if (!self->statement) {
|
||||
goto error;
|
||||
|
@ -652,7 +652,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue