diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -586,6 +586,17 @@ instantiation. +.. class:: WindowsRegistryImporter + + :term:`Finder` for modules declared in the Windows registry. This class + implements the :class:`importlib.abc.Finder` ABC. + + Only class methods are defined by this class to alleviate the need for + instantiation. + + .. versionadded:: 3.3 + + .. class:: PathFinder :term:`Finder` for :data:`sys.path`. This class implements the diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -64,7 +64,8 @@ raise NotImplementedError _register(Finder, machinery.BuiltinImporter, machinery.FrozenImporter, - machinery.PathFinder, machinery.FileFinder) + machinery.PathFinder, machinery.FileFinder, + machinery.WindowsRegistryImporter) class ResourceLoader(Loader): diff --git a/Lib/importlib/machinery.py b/Lib/importlib/machinery.py --- a/Lib/importlib/machinery.py +++ b/Lib/importlib/machinery.py @@ -6,6 +6,7 @@ OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES) from ._bootstrap import BuiltinImporter from ._bootstrap import FrozenImporter +from ._bootstrap import WindowsRegistryImporter from ._bootstrap import PathFinder from ._bootstrap import FileFinder from ._bootstrap import SourceFileLoader diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -33,7 +33,7 @@ class Finder(InheritanceTests, unittest.TestCase): subclasses = [machinery.BuiltinImporter, machinery.FrozenImporter, - machinery.PathFinder] + machinery.PathFinder, machinery.WindowsRegistryImporter] class Loader(InheritanceTests, unittest.TestCase):