Issue #27190: Raise NotSupportedError if sqlite3 is older than 3.3.1

Patch by Dave Sawyer.
This commit is contained in:
Berker Peksag 2016-06-12 14:09:51 +03:00
parent c415440faa
commit 7bea2347c7
3 changed files with 13 additions and 0 deletions

View file

@ -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();