gh-97850: Remove all known instances of module_repr() (#97876)

Remove all known instances of module_repr()
This commit is contained in:
Barry Warsaw 2022-10-05 11:42:26 -07:00 committed by GitHub
parent 815008a3a5
commit 5dc3599135
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 35 deletions

View file

@ -728,17 +728,6 @@ class BuiltinImporter:
_ORIGIN = "built-in"
@staticmethod
def module_repr(module):
"""Return repr for the module.
The method is deprecated. The import machinery does the job itself.
"""
_warnings.warn("BuiltinImporter.module_repr() is deprecated and "
"slated for removal in Python 3.12", DeprecationWarning)
return f'<module {module.__name__!r} ({BuiltinImporter._ORIGIN})>'
@classmethod
def find_spec(cls, fullname, path=None, target=None):
if path is not None:
@ -808,17 +797,6 @@ class FrozenImporter:
_ORIGIN = "frozen"
@staticmethod
def module_repr(m):
"""Return repr for the module.
The method is deprecated. The import machinery does the job itself.
"""
_warnings.warn("FrozenImporter.module_repr() is deprecated and "
"slated for removal in Python 3.12", DeprecationWarning)
return '<module {!r} ({})>'.format(m.__name__, FrozenImporter._ORIGIN)
@classmethod
def _fix_up_module(cls, module):
spec = module.__spec__