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

Method get_code

Lib/importlib/abc.py:172–185  ·  view source on GitHub ↗

Method to return the code object for fullname. Should return None if not applicable (e.g. built-in module). Raise ImportError if the module cannot be found.

(self, fullname)

Source from the content-addressed store, hash-verified

170 raise ImportError
171
172 def get_code(self, fullname):
173 """Method to return the code object for fullname.
174
175 Should return None if not applicable (e.g. built-in module).
176 Raise ImportError if the module cannot be found.
177 """
178 source = self.get_source(fullname)
179 if source is None:
180 return None
181 try:
182 path = self.get_filename(fullname)
183 except ImportError:
184 path = '<string>'
185 return self.source_to_code(source, path, fullname)
186
187_register(
188 ExecutionLoader,

Callers

nothing calls this directly

Calls 3

get_filenameMethod · 0.95
get_sourceMethod · 0.45
source_to_codeMethod · 0.45

Tested by

no test coverage detected