MCPcopy Index your code
hub / github.com/python/cpython / SourcelessFileLoader

Class SourcelessFileLoader

Lib/importlib/_bootstrap_external.py:979–1001  ·  view source on GitHub ↗

Loader which handles sourceless file imports.

Source from the content-addressed store, hash-verified

977
978
979class SourcelessFileLoader(FileLoader, _LoaderBasics):
980
981 """Loader which handles sourceless file imports."""
982
983 def get_code(self, fullname):
984 path = self.get_filename(fullname)
985 data = self.get_data(path)
986 # Call _classify_pyc to do basic validation of the pyc but ignore the
987 # result. There's no source to check against.
988 exc_details = {
989 'name': fullname,
990 'path': path,
991 }
992 _classify_pyc(data, fullname, exc_details)
993 return _compile_bytecode(
994 memoryview(data)[16:],
995 name=fullname,
996 bytecode_path=path,
997 )
998
999 def get_source(self, fullname):
1000 """Return None as there is no source code."""
1001 return None
1002
1003
1004class ExtensionFileLoader(FileLoader, _LoaderBasics):

Callers 1

_fix_up_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…