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

Method get_code

Lib/importlib/_bootstrap_external.py:983–997  ·  view source on GitHub ↗
(self, fullname)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 4

_classify_pycFunction · 0.85
_compile_bytecodeFunction · 0.85
get_filenameMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected