mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
bpo-42064: Move sqlite3 exceptions to global state, part 1 of 2 (GH-26745)
Also adds a test to verify the (borrowed) exceptions in `sqlite3.Connection`.
This commit is contained in:
parent
489699ca05
commit
a50e28377b
8 changed files with 66 additions and 48 deletions
|
|
@ -272,7 +272,8 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self)
|
|||
PyObject* error_msg;
|
||||
|
||||
if (self->reset) {
|
||||
PyErr_SetString(pysqlite_InterfaceError, errmsg_fetch_across_rollback);
|
||||
PyObject *exc = self->connection->InterfaceError;
|
||||
PyErr_SetString(exc, errmsg_fetch_across_rollback);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -822,7 +823,8 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
|
|||
}
|
||||
|
||||
if (self->reset) {
|
||||
PyErr_SetString(pysqlite_InterfaceError, errmsg_fetch_across_rollback);
|
||||
PyObject *exc = self->connection->InterfaceError;
|
||||
PyErr_SetString(exc, errmsg_fetch_across_rollback);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue