diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-01-06 00:02:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 00:02:43 (GMT) |
commit | cf0b23908cc902ac38cd83dd7ca5afdf89e1543b (patch) | |
tree | 213330fcd0db5954b3937e913a168fc7f68ebf4b /Modules/_sqlite | |
parent | c7f8d3caf0b10c19cd46b1b334a98628eac15672 (diff) | |
download | cpython-cf0b23908cc902ac38cd83dd7ca5afdf89e1543b.zip cpython-cf0b23908cc902ac38cd83dd7ca5afdf89e1543b.tar.gz cpython-cf0b23908cc902ac38cd83dd7ca5afdf89e1543b.tar.bz2 |
bpo-40810: Require SQLite 3.7.15 (GH-24106)
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/connection.c | 30 | ||||
-rw-r--r-- | Modules/_sqlite/module.c | 8 | ||||
-rw-r--r-- | Modules/_sqlite/util.h | 6 |
3 files changed, 6 insertions, 38 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 1e23dac..dbe5dd1 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -233,7 +233,7 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self) /* Clean up if user has not called .close() explicitly. */ if (self->db) { - SQLITE3_CLOSE(self->db); + sqlite3_close_v2(self->db); } Py_XDECREF(self->isolation_level); @@ -338,7 +338,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self) pysqlite_do_all_statements(self, ACTION_FINALIZE, 1); if (self->db) { - rc = SQLITE3_CLOSE(self->db); + rc = sqlite3_close_v2(self->db); if (rc != SQLITE_OK) { _pysqlite_seterror(self->db, NULL); @@ -1687,33 +1687,7 @@ pysqlite_connection_backup_impl(pysqlite_Connection *self, if (rc == SQLITE_NOMEM) { (void)PyErr_NoMemory(); } else { -#if SQLITE_VERSION_NUMBER > 3007015 PyErr_SetString(pysqlite_OperationalError, sqlite3_errstr(rc)); -#else - switch (rc) { - case SQLITE_ERROR: - /* Description of SQLITE_ERROR in SQLite 3.7.14 and older - releases. */ - PyErr_SetString(pysqlite_OperationalError, - "SQL logic error or missing database"); - break; - case SQLITE_READONLY: - PyErr_SetString(pysqlite_OperationalError, - "attempt to write a readonly database"); - break; - case SQLITE_BUSY: - PyErr_SetString(pysqlite_OperationalError, "database is locked"); - break; - case SQLITE_LOCKED: - PyErr_SetString(pysqlite_OperationalError, - "database table is locked"); - break; - default: - PyErr_Format(pysqlite_OperationalError, - "unrecognized error code: %d", rc); - break; - } -#endif } } diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index cd2eb57..6bfb1b7 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -29,8 +29,8 @@ #include "microprotocols.h" #include "row.h" -#if SQLITE_VERSION_NUMBER < 3007003 -#error "SQLite 3.7.3 or higher required" +#if SQLITE_VERSION_NUMBER < 3007015 +#error "SQLite 3.7.15 or higher required" #endif #include "clinic/module.c.h" @@ -365,8 +365,8 @@ PyMODINIT_FUNC PyInit__sqlite3(void) { PyObject *module; - if (sqlite3_libversion_number() < 3007003) { - PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.3 or higher required"); + if (sqlite3_libversion_number() < 3007015) { + PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.15 or higher required"); return NULL; } diff --git a/Modules/_sqlite/util.h b/Modules/_sqlite/util.h index c5a220e..cff31cd 100644 --- a/Modules/_sqlite/util.h +++ b/Modules/_sqlite/util.h @@ -39,10 +39,4 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st); sqlite_int64 _pysqlite_long_as_int64(PyObject * value); -#if SQLITE_VERSION_NUMBER >= 3007014 -#define SQLITE3_CLOSE sqlite3_close_v2 -#else -#define SQLITE3_CLOSE sqlite3_close -#endif - #endif |