8000 bpo-42264: Deprecate sqlite3.OptimizedUnicode by erlend-aasland · Pull Request #23163 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42264: Deprecate sqlite3.OptimizedUnicode #23163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension 8000

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review: Move deprecation warning to __init__.py
  • Loading branch information
Erlend E. Aasland committed Nov 5, 2020
commit b364cf5d3be0208861e3fe05ee248d4491932282
15 changes: 14 additions & 1 deletion Lib/sqlite3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@
# 3. This notice may not be removed or altered from any source distribution.

from .dbapi2 import *
from .deprecated import __getattr__


# 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 obsolete. You can safely remove it from your
code, as it defaults to 'str' anyway.
""")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
return str
raise AttributeError(f"module 'sqlite3' has no attribute '{name}'")
10 changes: 0 additions & 10 deletions Lib/sqlite3/deprecated.py

This file was deleted.

0