MCPcopy Index your code
hub / github.com/RustPython/RustPython / find_spec

Method find_spec

Lib/importlib/_bootstrap_external.py:715–734  ·  view source on GitHub ↗
(cls, fullname, path=None, target=None)

Source from the content-addressed store, hash-verified

713
714 @classmethod
715 def find_spec(cls, fullname, path=None, target=None):
716 _warnings.warn('importlib.machinery.WindowsRegistryFinder is '
717 'deprecated; use site configuration instead. '
718 'Future versions of Python may not enable this '
719 'finder by default.',
720 DeprecationWarning, stacklevel=2)
721
722 filepath = cls._search_registry(fullname)
723 if filepath is None:
724 return None
725 try:
726 _path_stat(filepath)
727 except OSError:
728 return None
729 for loader, suffixes in _get_supported_file_loaders():
730 if filepath.endswith(tuple(suffixes)):
731 spec = _bootstrap.spec_from_loader(fullname,
732 loader(fullname, filepath),
733 origin=filepath)
734 return spec
735
736
737class _LoaderBasics:

Callers

nothing calls this directly

Calls 5

_path_statFunction · 0.70
warnMethod · 0.45
_search_registryMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected