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

Method get_code

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

Source from the content-addressed store, hash-verified

1009 """Loader which handles sourceless file imports."""
1010
1011 def get_code(self, fullname):
1012 path = self.get_filename(fullname)
1013 data = self.get_data(path)
1014 # Call _classify_pyc to do basic validation of the pyc but ignore the
1015 # result. There's no source to check against.
1016 exc_details = {
1017 'name': fullname,
1018 'path': path,
1019 }
1020 _classify_pyc(data, fullname, exc_details)
1021 return _compile_bytecode(
1022 memoryview(data)[16:],
1023 name=fullname,
1024 bytecode_path=path,
1025 )
1026
1027 def get_source(self, fullname):
1028 """Return None as there is no source code."""

Callers

nothing calls this directly

Calls 4

_classify_pycFunction · 0.70
_compile_bytecodeFunction · 0.70
get_filenameMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected