mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules/) (#102196)
This commit is contained in:
parent
568fc0dee4
commit
2db23d10bf
18 changed files with 136 additions and 169 deletions
|
@ -705,11 +705,10 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
|
|||
Py_DECREF(adapted);
|
||||
|
||||
if (rc != SQLITE_OK) {
|
||||
PyObject *exc, *val, *tb;
|
||||
PyErr_Fetch(&exc, &val, &tb);
|
||||
PyObject *exc = PyErr_GetRaisedException();
|
||||
sqlite3 *db = sqlite3_db_handle(self->st);
|
||||
_pysqlite_seterror(state, db);
|
||||
_PyErr_ChainExceptions(exc, val, tb);
|
||||
_PyErr_ChainExceptions1(exc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -765,11 +764,10 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
|
|||
Py_DECREF(adapted);
|
||||
|
||||
if (rc != SQLITE_OK) {
|
||||
PyObject *exc, *val, *tb;
|
||||
PyErr_Fetch(&exc, &val, &tb);
|
||||
PyObject *exc = PyErr_GetRaisedException();
|
||||
sqlite3 *db = sqlite3_db_handle(self->st);
|
||||
_pysqlite_seterror(state, db);
|
||||
_PyErr_ChainExceptions(exc, val, tb);
|
||||
_PyErr_ChainExceptions1(exc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue