gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules/) (#102196)

This commit is contained in:
Irit Katriel 2023-02-24 21:43:03 +00:00 committed by GitHub
parent 568fc0dee4
commit 2db23d10bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 136 additions and 169 deletions

View file

@ -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;
}
}