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

Method get_source

Lib/importlib/_bootstrap_external.py:808–816  ·  view source on GitHub ↗

Concrete implementation of InspectLoader.get_source.

(self, fullname)

Source from the content-addressed store, hash-verified

806
807
808 def get_source(self, fullname):
809 """Concrete implementation of InspectLoader.get_source."""
810 path = self.get_filename(fullname)
811 try:
812 source_bytes = self.get_data(path)
813 except OSError as exc:
814 raise ImportError('source not available through get_data()',
815 name=fullname) from exc
816 return decode_source(source_bytes)
817
818 def source_to_code(self, data, path, *, _optimize=-1):
819 """Return the code object compiled from source.

Callers

nothing calls this directly

Calls 3

get_dataMethod · 0.95
decode_sourceFunction · 0.70
get_filenameMethod · 0.45

Tested by

no test coverage detected