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

Method _get_source

crates/wasm/Lib/whlimport.py:127–133  ·  view source on GitHub ↗
(cls, spec)

Source from the content-addressed store, hash-verified

125
126 @classmethod
127 def _get_source(cls, spec):
128 origin = spec.origin and remove_prefix(spec.origin, "zip:")
129 if not origin:
130 raise ImportError(f"{spec.name!r} is not a zip module")
131
132 zipname, slash, path = origin.partition("/")
133 return cls._packages[zipname].read(path).decode()
134
135 @classmethod
136 def exec_module(cls, module):

Callers 2

get_sourceMethod · 0.80
exec_moduleMethod · 0.80

Calls 4

remove_prefixFunction · 0.85
partitionMethod · 0.45
decodeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected