From 7bea2347c7e8af2c6b59e541c4039c34c7a8f6b2 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 12 Jun 2016 14:09:51 +0300 Subject: Issue #27190: Raise NotSupportedError if sqlite3 is older than 3.3.1 Patch by Dave Sawyer. --- Modules/_sqlite/connection.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Modules/_sqlite') diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 7570624e04..6aa4764b6c 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -164,6 +164,10 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject #ifdef WITH_THREAD self->thread_ident = PyThread_get_thread_ident(); #endif + if (!check_same_thread && sqlite3_libversion_number() < 3003001) { + PyErr_SetString(pysqlite_NotSupportedError, "shared connections not available"); + return -1; + } self->check_same_thread = check_same_thread; self->function_pinboard = PyDict_New(); -- cgit v1.2.1