Skip to content
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

gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning #128007

Merged
merged 15 commits into from
Jan 15, 2025
Merged
Prev Previous commit
Next Next commit
Improve deprecation message
Co-authored-by: Brett Cannon <brett@python.org>
  • Loading branch information
tomasr8 and brettcannon authored Jan 7, 2025
commit a22637b472d6c4421bb9206cec56c017dfac1165
4 changes: 2 additions & 2 deletions Lib/importlib/machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def __getattr__(name):

if name == 'DEBUG_BYTECODE_SUFFIXES':
warnings.warn('importlib.machinery.DEBUG_BYTECODE_SUFFIXES is '
'deprecated. Use importlib.machinery.BYTECODE_SUFFIXES '
'deprecated; use importlib.machinery.BYTECODE_SUFFIXES '
'instead.',
DeprecationWarning, stacklevel=2)
return _DEBUG_BYTECODE_SUFFIXES
elif name == 'OPTIMIZED_BYTECODE_SUFFIXES':
warnings.warn('importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES is '
'deprecated. Use importlib.machinery.BYTECODE_SUFFIXES '
'deprecated; use importlib.machinery.BYTECODE_SUFFIXES '
'instead.',
DeprecationWarning, stacklevel=2)
return _OPTIMIZED_BYTECODE_SUFFIXES
Expand Down
Loading