From ffc58a9710172b2d716a810a9f303828f3ebf108 Mon Sep 17 00:00:00 2001 From: Kalyan Date: Wed, 8 Jun 2022 05:04:50 +0530 Subject: gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482) Co-authored-by: Alex Waygood Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Erlend E. Aasland --- Lib/sqlite3/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Lib/sqlite3/__init__.py') diff --git a/Lib/sqlite3/__init__.py b/Lib/sqlite3/__init__.py index 34a9c047dd..927267cf0b 100644 --- a/Lib/sqlite3/__init__.py +++ b/Lib/sqlite3/__init__.py @@ -55,3 +55,16 @@ The sqlite3 module is written by Gerhard Häring . """ from sqlite3.dbapi2 import * +from sqlite3.dbapi2 import (_deprecated_names, + _deprecated_version_info, + _deprecated_version) + + +def __getattr__(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}") -- cgit v1.2.1