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

Function _compile_bytecode

Lib/importlib/_bootstrap_external.py:498–508  ·  view source on GitHub ↗

Compile bytecode as found in a pyc.

(data, name=None, bytecode_path=None, source_path=None)

Source from the content-addressed store, hash-verified

496
497
498def _compile_bytecode(data, name=None, bytecode_path=None, source_path=None):
499 """Compile bytecode as found in a pyc."""
500 code = marshal.loads(data)
501 if isinstance(code, _code_type):
502 _bootstrap._verbose_message('code object from {!r}', bytecode_path)
503 if source_path is not None:
504 _imp._fix_co_filename(code, source_path)
505 return code
506 else:
507 raise ImportError(f'Non-code object in {bytecode_path!r}',
508 name=name, path=bytecode_path)
509
510
511def _code_to_timestamp_pyc(code, mtime=0, source_size=0):

Callers 2

get_codeMethod · 0.85
get_codeMethod · 0.85

Calls 1

loadsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…