summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/statement.c
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2006-04-23 15:24:26 (GMT)
committerGerhard Häring <gh@ghaering.de>2006-04-23 15:24:26 (GMT)
commit3e99c0ad649de0393d9a8af17f34d9d1f55f4ab2 (patch)
treeeccb1576b1380f17d880133f1fbf92df8456295d /Modules/_sqlite/statement.c
parent5ef9d9fdb93cd5bd5179d8ce63c28248a4614d44 (diff)
downloadcpython-3e99c0ad649de0393d9a8af17f34d9d1f55f4ab2.zip
cpython-3e99c0ad649de0393d9a8af17f34d9d1f55f4ab2.tar.gz
cpython-3e99c0ad649de0393d9a8af17f34d9d1f55f4ab2.tar.bz2
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
Diffstat (limited to 'Modules/_sqlite/statement.c')
-rw-r--r--Modules/_sqlite/statement.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 0c93651..55923e7 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -64,6 +64,7 @@ int statement_create(Statement* self, Connection* connection, PyObject* sql)
return rc;
}
+ self->in_weakreflist = NULL;
self->sql = sql_str;
sql_cstr = PyString_AsString(sql_str);
@@ -304,6 +305,10 @@ void statement_dealloc(Statement* self)
Py_XDECREF(self->sql);
+ if (self->in_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject*)self);
+ }
+
self->ob_type->tp_free((PyObject*)self);
}
@@ -398,12 +403,12 @@ PyTypeObject StatementType = {
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */
0, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
+ offsetof(Statement, in_weakreflist), /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */