| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ | |||
| 4 | 4 | from . import machinery | |
| 5 | 5 | try: | |
| 6 | 6 | import _frozen_importlib | |
| 7 | - # import _frozen_importlib_external | ||
| 8 | 7 | except ImportError as exc: | |
| 9 | 8 | if exc.name != '_frozen_importlib': | |
| 10 | 9 | raise | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -263,11 +263,6 @@ class LazyLoader(abc.Loader): | |||
| 263 | 263 | def __check_eager_loader(loader): | |
| 264 | 264 | if not hasattr(loader, 'exec_module'): | |
| 265 | 265 | raise TypeError('loader must define exec_module()') | |
| 266 | - elif hasattr(loader.__class__, 'create_module'): | ||
| 267 | - if abc.Loader.create_module != loader.__class__.create_module: | ||
| 268 | - # Only care if create_module() is overridden in a subclass of | ||
| 269 | - # importlib.abc.Loader. | ||
| 270 | - raise TypeError('loader cannot define create_module()') | ||
| 271 | 266 | ||
| 272 | 267 | @classmethod | |
| 273 | 268 | def factory(cls, loader): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,6 +54,7 @@ class LazyLoaderTests(unittest.TestCase): | |||
| 54 | 54 | ||
| 55 | 55 | def test_init(self): | |
| 56 | 56 | with self.assertRaises(TypeError): | |
| 57 | + # Classes that dono't define exec_module() trigger TypeError. | ||
| 57 | 58 | util.LazyLoader(object) | |
| 58 | 59 | ||
| 59 | 60 | def new_module(self, source_code=None): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,6 +185,9 @@ Core and Builtins | |||
| 185 | 185 | ||
| 186 | 186 | Library | |
| 187 | 187 | ------- | |
| 188 | + | ||
| 189 | + Issue #26186: Remove an invalid type check in importlib.util.LazyLoader. | ||
| 190 | + | ||
| 188 | 191 | - Issue #26367: importlib.__init__() raises ImportError like | |
| 189 | 192 | builtins.__import__() when ``level`` is specified but without an accompanying | |
| 190 | 193 | package specified. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments