diff options
| author | shadchin <[email protected]> | 2024-02-12 07:53:52 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2024-02-14 14:26:16 +0000 |
| commit | 31f2a419764a8ba77c2a970cfc80056c6cd06756 (patch) | |
| tree | c1995d239eba8571cefc640f6648e1d5dd4ce9e2 /contrib/tools/python3/src/Lib/sqlite3/__init__.py | |
| parent | fe2ef02b38d9c85d80060963b265a1df9f38c3bb (diff) | |
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'contrib/tools/python3/src/Lib/sqlite3/__init__.py')
| -rw-r--r-- | contrib/tools/python3/src/Lib/sqlite3/__init__.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/contrib/tools/python3/src/Lib/sqlite3/__init__.py b/contrib/tools/python3/src/Lib/sqlite3/__init__.py index 5a2dbd360fb..927267cf0b9 100644 --- a/contrib/tools/python3/src/Lib/sqlite3/__init__.py +++ b/contrib/tools/python3/src/Lib/sqlite3/__init__.py @@ -55,17 +55,16 @@ The sqlite3 module is written by Gerhard Häring <[email protected]>. """ from sqlite3.dbapi2 import * +from sqlite3.dbapi2 import (_deprecated_names, + _deprecated_version_info, + _deprecated_version) -# bpo-42264: OptimizedUnicode was deprecated in Python 3.10. It's scheduled -# for removal in Python 3.12. def __getattr__(name): - if name == "OptimizedUnicode": - import warnings - msg = (""" - OptimizedUnicode is deprecated and will be removed in Python 3.12. - Since Python 3.3 it has simply been an alias for 'str'. - """) - warnings.warn(msg, DeprecationWarning, stacklevel=2) - return str - raise AttributeError(f"module 'sqlite3' has no attribute '{name}'") + if name in _deprecated_names: + from warnings import warn + + warn(f"{name} is deprecated and will be removed in Python 3.14", + DeprecationWarning, stacklevel=2) + return globals()[f"_deprecated_{name}"] + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
