diff options
author | Brett Cannon <brett@python.org> | 2016-02-20 18:35:41 -0800 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-02-20 18:35:41 -0800 |
commit | 558823a0cf7834cb8bc45123604008e33b4e69e2 (patch) | |
tree | 9f381020ea9dca25831e6fcea2aa63d76b9189e9 /Lib/importlib/util.py | |
parent | 4f38cb41fe022c94bb5569c72d8b48020d8c13d4 (diff) | |
download | cpython-git-558823a0cf7834cb8bc45123604008e33b4e69e2.tar.gz |
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.
Diffstat (limited to 'Lib/importlib/util.py')
-rw-r--r-- | Lib/importlib/util.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py index 1dbff2605e..4525b3f78e 100644 --- a/Lib/importlib/util.py +++ b/Lib/importlib/util.py @@ -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): |