mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-97850: Remove all known instances of module_repr() (#97876)
Remove all known instances of module_repr()
This commit is contained in:
parent
815008a3a5
commit
5dc3599135
6 changed files with 7 additions and 35 deletions
|
|
@ -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__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue