File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -272,8 +272,8 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self)
272272 PyObject * error_msg ;
273273
274274 if (self -> reset ) {
275- pysqlite_state * state = pysqlite_get_state ( NULL ) ;
276- PyErr_SetString (state -> InterfaceError , errmsg_fetch_across_rollback );
275+ PyObject * exc = self -> connection -> InterfaceError ;
276+ PyErr_SetString (exc , errmsg_fetch_across_rollback );
277277 return NULL ;
278278 }
279279
@@ -823,8 +823,8 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
823823 }
824824
825825 if (self -> reset ) {
826- pysqlite_state * state = pysqlite_get_state ( NULL ) ;
827- PyErr_SetString (state -> InterfaceError , errmsg_fetch_across_rollback );
826+ PyObject * exc = self -> connection -> InterfaceError ;
827+ PyErr_SetString (exc , errmsg_fetch_across_rollback );
828828 return NULL ;
829829 }
830830
Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
5656 Py_ssize_t size ;
5757 const char * sql_cstr = PyUnicode_AsUTF8AndSize (sql , & size );
5858 if (sql_cstr == NULL ) {
59- PyErr_Format ( state -> Warning ,
60- "SQL is of wrong type ('%s'). Must be string." ,
59+ PyObject * exc = connection -> Warning ;
60+ PyErr_Format ( exc , "SQL is of wrong type ('%s'). Must be string." ,
6161 Py_TYPE (sql )-> tp_name );
6262 return NULL ;
6363 }
@@ -87,8 +87,8 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
8787 }
8888
8989 if (pysqlite_check_remaining_sql (tail )) {
90- PyErr_SetString ( state -> Warning ,
91- "You can only execute one statement at a time." );
90+ PyObject * exc = connection -> Warning ;
91+ PyErr_SetString ( exc , "You can only execute one statement at a time." );
9292 goto error ;
9393 }
9494
You can’t perform that action at this time.
0 commit comments