summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>2022-05-16 17:52:08 (GMT)
committerGitHub <noreply@github.com>2022-05-16 17:52:08 (GMT)
commit00f22e8cc234aa52ec1f28094a170d7b87d0d08f (patch)
treea59310dd786b5de47629857f039bff45ee4c2232 /Modules/_sqlite
parent9b50585e0225a80f9e383edacc7d73f1b5c8008b (diff)
downloadcpython-00f22e8cc234aa52ec1f28094a170d7b87d0d08f.zip
cpython-00f22e8cc234aa52ec1f28094a170d7b87d0d08f.tar.gz
cpython-00f22e8cc234aa52ec1f28094a170d7b87d0d08f.tar.bz2
gh-92547: Remove deprecated sqlite3 features (#92548)
The following sqlite3 features were deprecated in 3.10, scheduled for removal in 3.12: - sqlite3.OptimizedUnicode (gh-23163) - sqlite3.enable_shared_cache (gh-24008) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Signed-off-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/clinic/module.c.h42
-rw-r--r--Modules/_sqlite/module.c31
2 files changed, 1 insertions, 72 deletions
diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h
index 8f7008a..74a6a36 100644
--- a/Modules/_sqlite/clinic/module.c.h
+++ b/Modules/_sqlite/clinic/module.c.h
@@ -158,46 +158,6 @@ exit:
return return_value;
}
-PyDoc_STRVAR(pysqlite_enable_shared_cache__doc__,
-"enable_shared_cache($module, /, do_enable)\n"
-"--\n"
-"\n"
-"Enable or disable shared cache mode for the calling thread.\n"
-"\n"
-"This method is deprecated and will be removed in Python 3.12.\n"
-"Shared cache is strongly discouraged by the SQLite 3 documentation.\n"
-"If shared cache must be used, open the database in URI mode using\n"
-"the cache=shared query parameter.");
-
-#define PYSQLITE_ENABLE_SHARED_CACHE_METHODDEF \
- {"enable_shared_cache", _PyCFunction_CAST(pysqlite_enable_shared_cache), METH_FASTCALL|METH_KEYWORDS, pysqlite_enable_shared_cache__doc__},
-
-static PyObject *
-pysqlite_enable_shared_cache_impl(PyObject *module, int do_enable);
-
-static PyObject *
-pysqlite_enable_shared_cache(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
-{
- PyObject *return_value = NULL;
- static const char * const _keywords[] = {"do_enable", NULL};
- static _PyArg_Parser _parser = {NULL, _keywords, "enable_shared_cache", 0};
- PyObject *argsbuf[1];
- int do_enable;
-
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- do_enable = _PyLong_AsInt(args[0]);
- if (do_enable == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = pysqlite_enable_shared_cache_impl(module, do_enable);
-
-exit:
- return return_value;
-}
-
PyDoc_STRVAR(pysqlite_register_adapter__doc__,
"register_adapter($module, type, caster, /)\n"
"--\n"
@@ -334,4 +294,4 @@ skip_optional:
exit:
return return_value;
}
-/*[clinic end generated code: output=d846459943008a9c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=43aa4f4356f9269d input=a9049054013a1b77]*/
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index fbc57c7..78591f8 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -106,36 +106,6 @@ pysqlite_complete_statement_impl(PyObject *module, const char *statement)
}
/*[clinic input]
-_sqlite3.enable_shared_cache as pysqlite_enable_shared_cache
-
- do_enable: int
-
-Enable or disable shared cache mode for the calling thread.
-
-This method is deprecated and will be removed in Python 3.12.
-Shared cache is strongly discouraged by the SQLite 3 documentation.
-If shared cache must be used, open the database in URI mode using
-the cache=shared query parameter.
-[clinic start generated code]*/
-
-static PyObject *
-pysqlite_enable_shared_cache_impl(PyObject *module, int do_enable)
-/*[clinic end generated code: output=259c74eedee1516b input=26e40d5971d3487d]*/
-{
- int rc;
-
- rc = sqlite3_enable_shared_cache(do_enable);
-
- if (rc != SQLITE_OK) {
- pysqlite_state *state = pysqlite_get_state(module);
- PyErr_SetString(state->OperationalError, "Changing the shared_cache flag failed");
- return NULL;
- } else {
- Py_RETURN_NONE;
- }
-}
-
-/*[clinic input]
_sqlite3.register_adapter as pysqlite_register_adapter
type: object(type='PyTypeObject *')
@@ -277,7 +247,6 @@ static PyMethodDef module_methods[] = {
PYSQLITE_COMPLETE_STATEMENT_METHODDEF
PYSQLITE_CONNECT_METHODDEF
PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF
- PYSQLITE_ENABLE_SHARED_CACHE_METHODDEF
PYSQLITE_REGISTER_ADAPTER_METHODDEF
PYSQLITE_REGISTER_CONVERTER_METHODDEF
{NULL, NULL}