Erlend Egeberg Aasland <erlend.aasl...@innova.no> added the comment:
Maybe it's better to send the event only if the connection succeeded: diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 8dbfa7b38a..0220978cf2 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -97,6 +97,12 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject* result = PyObject_Call(factory, args, kwargs); + if (result) { + if (PySys_Audit("sqlite3.connected", "O", self) < 0) { + return -1; + } + } + return result; } ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43762> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com