mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044)
This commit is contained in:
parent
cf35e05f89
commit
a7ff6df60c
9 changed files with 1012 additions and 962 deletions
|
@ -1324,6 +1324,9 @@ class PathFinder:
|
|||
if hasattr(finder, 'find_loader'):
|
||||
loader, portions = finder.find_loader(fullname)
|
||||
else:
|
||||
msg = (f"{_bootstrap._object_name(finder)}.find_spec() not found; "
|
||||
"falling back to find_module()")
|
||||
_warnings.warn(msg, ImportWarning)
|
||||
loader = finder.find_module(fullname)
|
||||
portions = []
|
||||
if loader is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue