diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-01-06 01:36:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 02:36:04 +0200 |
commit | ddb5e11683c8db9d2095f2f9406701443c4dc9b3 (patch) | |
tree | 1f6aade790390220158f852c9e78d9e58faa27d8 /Lib/sqlite3/dbapi2.py | |
parent | f9949f82e17c88609adb53eff3a7d5cd63a645bd (diff) | |
download | cpython-git-ddb5e11683c8db9d2095f2f9406701443c4dc9b3.tar.gz |
bpo-24464: Deprecate sqlite3.enable_shared_cache (GH-24008)
Diffstat (limited to 'Lib/sqlite3/dbapi2.py')
-rw-r--r-- | Lib/sqlite3/dbapi2.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/sqlite3/dbapi2.py b/Lib/sqlite3/dbapi2.py index 991682ce9e..6475f98a64 100644 --- a/Lib/sqlite3/dbapi2.py +++ b/Lib/sqlite3/dbapi2.py @@ -84,6 +84,20 @@ def register_adapters_and_converters(): register_adapters_and_converters() +# bpo-24464: enable_shared_cache was deprecated in Python 3.10. It's +# scheduled for removal in Python 3.12. +def enable_shared_cache(enable): + from _sqlite3 import enable_shared_cache as _old_enable_shared_cache + import warnings + msg = ( + "enable_shared_cache 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." + ) + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return _old_enable_shared_cache + # Clean up namespace del(register_adapters_and_converters) |