@@ -84,9 +84,7 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
84
84
return NULL ;
85
85
}
86
86
87
- self -> db = connection -> db ;
88
87
self -> st = NULL ;
89
- self -> sql = Py_NewRef (sql );
90
88
self -> in_use = 0 ;
91
89
self -> is_dml = 0 ;
92
90
self -> in_weakreflist = NULL ;
@@ -110,7 +108,7 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
110
108
}
111
109
112
110
Py_BEGIN_ALLOW_THREADS
113
- rc = sqlite3_prepare_v2 (self -> db ,
111
+ rc = sqlite3_prepare_v2 (connection -> db ,
114
112
sql_cstr ,
115
113
(int )sql_cstr_len + 1 ,
116
114
& self -> st ,
@@ -120,7 +118,7 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
120
118
PyObject_GC_Track (self );
121
119
122
120
if (rc != SQLITE_OK ) {
123
- _pysqlite_seterror (self -> db );
121
+ _pysqlite_seterror (connection -> db );
124
122
goto error ;
125
123
}
126
124
@@ -409,23 +407,14 @@ stmt_dealloc(pysqlite_Statement *self)
409
407
Py_END_ALLOW_THREADS
410
408
self -> st = 0 ;
411
409
}
412
- tp -> tp_clear ((PyObject * )self );
413
410
tp -> tp_free (self );
414
411
Py_DECREF (tp );
415
412
}
416
413
417
- static int
418
- stmt_clear (pysqlite_Statement * self )
419
- {
420
- Py_CLEAR (self -> sql );
421
- return 0 ;
422
- }
423
-
424
414
static int
425
415
stmt_traverse (pysqlite_Statement * self , visitproc visit , void * arg )
426
416
{
427
417
Py_VISIT (Py_TYPE (self ));
428
- Py_VISIT (self -> sql );
429
418
return 0 ;
430
419
}
431
420
@@ -507,7 +496,6 @@ static PyType_Slot stmt_slots[] = {
507
496
{Py_tp_members , stmt_members },
508
497
{Py_tp_dealloc , stmt_dealloc },
509
498
{Py_tp_traverse , stmt_traverse },
510
- {Py_tp_clear , stmt_clear },
511
499
{0 , NULL },
512
500
};
513
501
0 commit comments