bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)

This commit is contained in:
Zackery Spytz 2018-12-17 07:52:45 -07:00 committed by Serhiy Storchaka
parent 4db62e1158
commit 842acaab13
15 changed files with 81 additions and 4 deletions

View file

@ -1161,6 +1161,10 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel
static int
pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored))
{
if (isolation_level == NULL) {
PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
return -1;
}
if (isolation_level == Py_None) {
PyObject *res = pysqlite_connection_commit(self, NULL);
if (!res) {