Skip to content
Merged
Prev Previous commit
Fit lines to 80 columns
  • Loading branch information
sergey-miryanov committed Feb 17, 2025
commit 4fde8de22647d3f6bd61e6bd0cb558e87c9655fc
15 changes: 10 additions & 5 deletions Modules/_testexternalinspection.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ search_section_in_file(

munmap(map, fs.st_size);
if (close(fd) != 0) {
// This might hide one of the above exceptions, maybe we should chain them?
// This might hide one of the above exceptions, maybe we
// should chain them?
PyErr_SetFromErrno(PyExc_OSError);
}
return result;
Expand Down Expand Up @@ -265,7 +266,8 @@ search_map_for_section(pid_t pid, const char* secname, const char* substr) {
address += size;
}

PyErr_SetString(PyExc_RuntimeError, "mach_vm_region failed to find the section");
PyErr_SetString(PyExc_RuntimeError,
"mach_vm_region failed to find the section");
return 0;
}

Expand Down Expand Up @@ -312,7 +314,8 @@ find_map_start_address(pid_t pid, char* result_filename, const char* map)

if (!match_found) {
map_filename[0] = '\0';
PyErr_Format(PyExc_RuntimeError, "Cannot find map start address for map: %s", map);
PyErr_Format(PyExc_RuntimeError,
"Cannot find map start address for map: %s", map);
}

return result_address;
Expand Down Expand Up @@ -408,7 +411,8 @@ search_map_for_section(pid_t pid, const char* secname, const char* map)
static uintptr_t
search_map_for_section(pid_t pid, const char* secname, const char* map)
{
PyErr_SetString(PyExc_NotImplementedError, "Not supported on this platform");
PyErr_SetString(PyExc_NotImplementedError,
"Not supported on this platform");
return 0;
}
#endif
Expand All @@ -427,7 +431,8 @@ get_py_runtime(pid_t pid)
static uintptr_t
get_async_debug(pid_t pid)
{
uintptr_t result = search_map_for_section(pid, "AsyncioDebug", "_asyncio.cpython");
uintptr_t result = search_map_for_section(pid, "AsyncioDebug",
"_asyncio.cpython");
if (result == 0 && !PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError, "Cannot find AsyncioDebug section");
}
Expand Down
Loading