MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read_code

Function read_code

tools/python-3.11.9-amd64/Lib/pkgutil.py:40–50  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

38
39
40def read_code(stream):
41 # This helper is needed in order for the PEP 302 emulation to
42 # correctly handle compiled files
43 import marshal
44
45 magic = stream.read(4)
46 if magic != importlib.util.MAGIC_NUMBER:
47 return None
48
49 stream.read(12) # Skip rest of the header
50 return marshal.load(stream)
51
52
53def walk_packages(path=None, prefix='', onerror=None):

Callers 3

_get_code_from_fileFunction · 0.90
get_codeMethod · 0.85
_render_stackMethod · 0.85

Calls 2

readMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected