mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing.
This commit is contained in:
parent
bddecc3861
commit
658af31372
3 changed files with 22 additions and 1 deletions
|
@ -461,6 +461,8 @@ def get_loader(module_or_name):
|
|||
loader = getattr(module, '__loader__', None)
|
||||
if loader is not None:
|
||||
return loader
|
||||
if getattr(module, '__spec__', None) is None:
|
||||
return None
|
||||
fullname = module.__name__
|
||||
else:
|
||||
fullname = module_or_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue