Skip to content

Instantly share code, notes, and snippets.

@Chaz6
Created October 13, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chaz6/bea6fc23182fdc4a043286afb51488be to your computer and use it in GitHub Desktop.
Save Chaz6/bea6fc23182fdc4a043286afb51488be to your computer and use it in GitHub Desktop.
Patch to support current SQLlite with Python 3.9
--- Python-3.9.0/Modules/_sqlite/connection.c.old 2020-10-05 16:07:58.000000000 +0100
+++ Python-3.9.0/Modules/_sqlite/connection.c 2020-10-13 16:40:28.161985539 +0100
@@ -1063,10 +1063,10 @@
if (trace_callback == Py_None) {
/* None clears the trace callback previously set */
- sqlite3_trace(self->db, 0, (void*)0);
+ sqlite3_trace_v2(self->db, SQLITE_TRACE_STMT, 0, (void*)0);
Py_XSETREF(self->function_pinboard_trace_callback, NULL);
} else {
- sqlite3_trace(self->db, _trace_callback, trace_callback);
+ sqlite3_trace_v2(self->db, SQLITE_TRACE_STMT, _trace_callback, trace_callback);
Py_INCREF(trace_callback);
Py_XSETREF(self->function_pinboard_trace_callback, trace_callback);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment