(
corefile: pathlib.Path, bss: VirtualMap
)
| 48 | |
| 49 | |
| 50 | def 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 | |
| 63 | def _get_python_version_from_map_information( |
no outgoing calls