[issue42137] Raise an ImportWarning for calling module_repr() on loaders

2021-03-20 Thread Brett Cannon
Brett Cannon added the comment: Should try to use __spec__ first, but if it isn't set then fall back on module_repr() and raise an ImportWarning. See Lib/importlib/_bootstrap.py:_module_repr. -- ___ Python tracker

[issue42137] Raise an ImportWarning for calling module_repr() on loaders

2020-10-23 Thread Brett Cannon
Change by Brett Cannon : -- dependencies: +[importlib] deprecate module_repr() methods ___ Python tracker ___ ___ Python-bugs-list

[issue42137] Raise an ImportWarning for calling module_repr() on loaders

2020-10-23 Thread Brett Cannon
New submission from Brett Cannon : Once all traces of module_repr() are gone, raise an `ImportWarning` when using `module_repr()`. Once this is implemented and has been out in the wild for a sufficient amount of time, it should be switching to a DeprecationWarning and then the fallback