return NULL;
}
- self->db = connection->db;
self->st = NULL;
- self->sql = Py_NewRef(sql);
self->in_use = 0;
self->is_dml = 0;
self->in_weakreflist = NULL;
}
Py_BEGIN_ALLOW_THREADS
- rc = sqlite3_prepare_v2(self->db,
+ rc = sqlite3_prepare_v2(connection->db,
sql_cstr,
(int)sql_cstr_len + 1,
&self->st,
PyObject_GC_Track(self);
if (rc != SQLITE_OK) {
- _pysqlite_seterror(self->db);
+ _pysqlite_seterror(connection->db);
goto error;
}
Py_END_ALLOW_THREADS
self->st = 0;
}
- tp->tp_clear((PyObject *)self);
tp->tp_free(self);
Py_DECREF(tp);
}
-static int
-stmt_clear(pysqlite_Statement *self)
-{
- Py_CLEAR(self->sql);
- return 0;
-}
-
static int
stmt_traverse(pysqlite_Statement *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->sql);
return 0;
}
{Py_tp_members, stmt_members},
{Py_tp_dealloc, stmt_dealloc},
{Py_tp_traverse, stmt_traverse},
- {Py_tp_clear, stmt_clear},
{0, NULL},
};