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

Function get_python_version_for_process

src/pystack/process.py:98–109  ·  view source on GitHub ↗
(
    pid: int, mapinfo: MemoryMapInformation
)

Source from the content-addressed store, hash-verified

96
97
98def get_python_version_for_process(
99 pid: int, mapinfo: MemoryMapInformation
100) -> Tuple[int, int]:
101 if mapinfo.bss is not None:
102 version_from_bss = scan_process_bss_for_python_version(pid, mapinfo.bss)
103 if version_from_bss is not None:
104 LOGGER.info(
105 "Version found by scanning the bss section: %d.%d", *version_from_bss
106 )
107 return version_from_bss
108
109 return _get_python_version_from_map_information(mapinfo)
110
111
112def get_python_version_for_core(