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

Function get_code_from_pyc

Lib/test/test_importlib/util.py:134–141  ·  view source on GitHub ↗

Reads a pyc file and returns the unmarshalled code object within. No header validation is performed.

(pyc_path)

Source from the content-addressed store, hash-verified

132
133
134def get_code_from_pyc(pyc_path):
135 """Reads a pyc file and returns the unmarshalled code object within.
136
137 No header validation is performed.
138 """
139 with open(pyc_path, 'rb') as pyc_f:
140 pyc_f.seek(16)
141 return marshal.load(pyc_f)
142
143
144@contextlib.contextmanager

Callers

nothing calls this directly

Calls 3

openFunction · 0.50
seekMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…