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

Function _compile_bytecode

Lib/importlib/_bootstrap_external.py:509–519  ·  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

507
508
509def _compile_bytecode(data, name=None, bytecode_path=None, source_path=None):
510 """Compile bytecode as found in a pyc."""
511 code = marshal.loads(data)
512 if isinstance(code, _code_type):
513 _bootstrap._verbose_message('code object from {!r}', bytecode_path)
514 if source_path is not None:
515 _imp._fix_co_filename(code, source_path)
516 return code
517 else:
518 raise ImportError(f'Non-code object in {bytecode_path!r}',
519 name=name, path=bytecode_path)
520
521
522def _code_to_timestamp_pyc(code, mtime=0, source_size=0):

Callers 2

get_codeMethod · 0.70
get_codeMethod · 0.70

Calls 2

isinstanceFunction · 0.85
loadsMethod · 0.45

Tested by

no test coverage detected