mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #17099: Have importlib.find_loader() raise ValueError when
__loader__ is not set on a module. This brings the exception in line with when __loader__ is None (which is equivalent to not having the attribute defined).
This commit is contained in:
parent
542308eae7
commit
327992330e
4 changed files with 26 additions and 1 deletions
|
|
@ -68,6 +68,8 @@ def find_loader(name, path=None):
|
|||
return loader
|
||||
except KeyError:
|
||||
pass
|
||||
except AttributeError:
|
||||
raise ValueError('{}.__loader__ is not set'.format(name))
|
||||
return _bootstrap._find_module(name, path)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue