bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818)

This commit is contained in:
Erlend Egeberg Aasland 2021-05-02 23:25:17 +02:00 committed by GitHub
parent 37e0c7850d
commit c96cc089f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 13 deletions

View file

@ -91,20 +91,11 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
factory = (PyObject*)pysqlite_ConnectionType;
}
if (PySys_Audit("sqlite3.connect", "O", database) < 0) {
return NULL;
}
result = PyObject_Call(factory, args, kwargs);
if (result == NULL) {
return NULL;
}
if (PySys_Audit("sqlite3.connect/handle", "O", self) < 0) {
Py_DECREF(result);
return NULL;
}
return result;
}