mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #26186: Remove an invalid type check in
importlib.util.LazyLoader. The class was checking its argument as to whether its implementation of create_module() came directly from importlib.abc.Loader. The problem is that the classes coming from imoprtlib.machinery do not directly inherit from the ABC as they come from _frozen_importlib. Because the documentation has always said that create_module() was ignored, the check has simply been removed.
This commit is contained in:
parent
4f38cb41fe
commit
558823a0cf
4 changed files with 3 additions and 6 deletions
|
@ -263,11 +263,6 @@ class LazyLoader(abc.Loader):
|
|||
def __check_eager_loader(loader):
|
||||
if not hasattr(loader, 'exec_module'):
|
||||
raise TypeError('loader must define exec_module()')
|
||||
elif hasattr(loader.__class__, 'create_module'):
|
||||
if abc.Loader.create_module != loader.__class__.create_module:
|
||||
# Only care if create_module() is overridden in a subclass of
|
||||
# importlib.abc.Loader.
|
||||
raise TypeError('loader cannot define create_module()')
|
||||
|
||||
@classmethod
|
||||
def factory(cls, loader):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue