machinery.py 844 B

123456789101112131415161718192021
  1. """The machinery of importlib: finders, loaders, hooks, etc."""
  2. import _imp
  3. from ._bootstrap import ModuleSpec
  4. from ._bootstrap import BuiltinImporter
  5. from ._bootstrap import FrozenImporter
  6. from ._bootstrap_external import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
  7. OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES,
  8. EXTENSION_SUFFIXES)
  9. from ._bootstrap_external import WindowsRegistryFinder
  10. from ._bootstrap_external import PathFinder
  11. from ._bootstrap_external import FileFinder
  12. from ._bootstrap_external import SourceFileLoader
  13. from ._bootstrap_external import SourcelessFileLoader
  14. from ._bootstrap_external import ExtensionFileLoader
  15. def all_suffixes():
  16. """Returns a list of all recognized module suffixes for this process"""
  17. return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES