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

Method get_code

Lib/importlib/abc.py:119–130  ·  view source on GitHub ↗

Method which returns the code object for the module. The fullname is a str. Returns a types.CodeType if possible, else returns None if a code object does not make sense (e.g. built-in module). Raises ImportError if the module cannot be found.

(self, fullname)

Source from the content-addressed store, hash-verified

117 raise ImportError
118
119 def get_code(self, fullname):
120 """Method which returns the code object for the module.
121
122 The fullname is a str. Returns a types.CodeType if possible, else
123 returns None if a code object does not make sense
124 (e.g. built-in module). Raises ImportError if the module cannot be
125 found.
126 """
127 source = self.get_source(fullname)
128 if source is None:
129 return None
130 return self.source_to_code(source, '<string>', fullname)
131
132 @abc.abstractmethod
133 def get_source(self, fullname):

Callers

nothing calls this directly

Calls 2

get_sourceMethod · 0.95
source_to_codeMethod · 0.95

Tested by

no test coverage detected