MCPcopy Create free account
hub / github.com/bloomberg/pystack / scan_core_bss_for_python_version

Function scan_core_bss_for_python_version

src/pystack/process.py:50–60  ·  view source on GitHub ↗
(
    corefile: pathlib.Path, bss: VirtualMap
)

Source from the content-addressed store, hash-verified

48
49
50def scan_core_bss_for_python_version(
51 corefile: pathlib.Path, bss: VirtualMap
52) -> Optional[Tuple[int, int]]:
53 with open(corefile, "rb") as the_corefile:
54 the_corefile.seek(bss.offset)
55 data = the_corefile.read(bss.size)
56 match = next(BSS_VERSION_REGEXP.finditer(data), None)
57 if not match:
58 return None
59 _, major, minor, patch, *_ = match.groups()
60 return int(major), int(minor)
61
62
63def _get_python_version_from_map_information(

Calls

no outgoing calls