diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-08-02 11:45:24 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-08-02 11:45:24 (GMT) |
commit | ff79486bb5e353dd32fa422ff65a595a3ff1b554 (patch) | |
tree | 8f41923225164f4ea7ed5329964550863ec220dd /Lib | |
parent | 8a9080feffc757360d0d73e4173189586098ffb5 (diff) | |
download | cpython-ff79486bb5e353dd32fa422ff65a595a3ff1b554.zip cpython-ff79486bb5e353dd32fa422ff65a595a3ff1b554.tar.gz cpython-ff79486bb5e353dd32fa422ff65a595a3ff1b554.tar.bz2 |
Close #15519: Properly expose WindowsRegistryFinder in importlib and bring the name into line with normal import terminology. Original patch by Eric Snow
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 8 | ||||
-rw-r--r-- | Lib/importlib/abc.py | 2 | ||||
-rw-r--r-- | Lib/importlib/machinery.py | 1 | ||||
-rw-r--r-- | Lib/test/test_importlib/test_abc.py | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 5980141..7b6ef39 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -720,9 +720,9 @@ class FrozenImporter: return _imp.is_frozen_package(fullname) -class WindowsRegistryImporter: +class WindowsRegistryFinder: - """Meta path import for modules declared in the Windows registry. + """Meta path finder for modules declared in the Windows registry. """ REGISTRY_KEY = ( @@ -1683,7 +1683,7 @@ def _setup(sys_module, _imp_module): if builtin_os == 'nt': SOURCE_SUFFIXES.append('.pyw') if '_d.pyd' in _imp.extension_suffixes(): - WindowsRegistryImporter.DEBUG_BUILD = True + WindowsRegistryFinder.DEBUG_BUILD = True def _install(sys_module, _imp_module): @@ -1694,5 +1694,5 @@ def _install(sys_module, _imp_module): sys.meta_path.append(BuiltinImporter) sys.meta_path.append(FrozenImporter) if _os.__name__ == 'nt': - sys.meta_path.append(WindowsRegistryImporter) + sys.meta_path.append(WindowsRegistryFinder) sys.meta_path.append(PathFinder) diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index 5e71758..e8a0541 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -59,7 +59,7 @@ class MetaPathFinder(Finder): raise NotImplementedError _register(MetaPathFinder, machinery.BuiltinImporter, machinery.FrozenImporter, - machinery.PathFinder) + machinery.PathFinder, machinery.WindowsRegistryFinder) class PathEntryFinder(Finder): diff --git a/Lib/importlib/machinery.py b/Lib/importlib/machinery.py index 3fe0b11..fed6f2c 100644 --- a/Lib/importlib/machinery.py +++ b/Lib/importlib/machinery.py @@ -6,6 +6,7 @@ from ._bootstrap import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES, OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES) from ._bootstrap import BuiltinImporter from ._bootstrap import FrozenImporter +from ._bootstrap import WindowsRegistryFinder 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 index 90f38b8..aa87591 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -34,7 +34,7 @@ class MetaPathFinder(InheritanceTests, unittest.TestCase): superclasses = [abc.Finder] subclasses = [machinery.BuiltinImporter, machinery.FrozenImporter, - machinery.PathFinder] + machinery.PathFinder, machinery.WindowsRegistryFinder] class PathEntryFinder(InheritanceTests, unittest.TestCase): |