Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e70fa5

Browse files
[issue 19152] Ensure we have actually registered ExtensionFileLoader as an ExecutionLoader.
1 parent 17f1edd commit 7e70fa5

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/importlib/abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def init_module_attrs(self, module):
188188
load_module = _bootstrap._LoaderBasics.load_module
189189

190190
_register(InspectLoader, machinery.BuiltinImporter, machinery.FrozenImporter,
191-
machinery.ExtensionFileLoader, _bootstrap.NamespaceLoader)
191+
_bootstrap.NamespaceLoader)
192192

193193

194194
class ExecutionLoader(InspectLoader):
@@ -237,7 +237,7 @@ def init_module_attrs(self, module):
237237
super().init_module_attrs(module)
238238
_bootstrap._init_file_attrs(self, module)
239239

240-
_register(machinery.ExtensionFileLoader)
240+
_register(ExecutionLoader, machinery.ExtensionFileLoader)
241241

242242

243243
class FileLoader(_bootstrap.FileLoader, ResourceLoader, ExecutionLoader):

Lib/test/test_importlib/test_abc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class InspectLoader(InheritanceTests):
100100

101101
class ExecutionLoader(InheritanceTests):
102102
superclass_names = ['InspectLoader']
103+
subclass_names = ['ExtensionFileLoader']
103104

104105
tests = create_inheritance_tests(ExecutionLoader)
105106
Frozen_ExecutionLoaderInheritanceTests, Source_ExecutionLoaderInheritanceTests = tests

0 commit comments

Comments
 (0)