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

Function get_python_version_for_core

src/pystack/process.py:112–122  ·  view source on GitHub ↗
(
    corefile: pathlib.Path, executable: pathlib.Path, mapinfo: MemoryMapInformation
)

Source from the content-addressed store, hash-verified

110
111
112def get_python_version_for_core(
113 corefile: pathlib.Path, executable: pathlib.Path, mapinfo: MemoryMapInformation
114) -> Tuple[int, int]:
115 if mapinfo.bss is not None:
116 version_from_bss = scan_core_bss_for_python_version(corefile, mapinfo.bss)
117 if version_from_bss is not None:
118 LOGGER.info(
119 "Version found by scanning the bss section: %d.%d", *version_from_bss
120 )
121 return version_from_bss
122 return _get_python_version_from_map_information(mapinfo)
123
124
125def is_elf(filename: pathlib.Path) -> bool: