diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-08-01-20-31-30.gh-issue-137293.4x3JbV.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-08-01-20-31-30.gh-issue-137293.4x3JbV.rst new file mode 100644 index 00000000000000..83289d4d9bc875 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-08-01-20-31-30.gh-issue-137293.4x3JbV.rst @@ -0,0 +1 @@ +Fix :exc:`SystemError` when searching ELF Files in :func:`sys.remote_exec`. diff --git a/Python/remote_debug.h b/Python/remote_debug.h index 5324a7aaa6f5e5..08f90b2e51207e 100644 --- a/Python/remote_debug.h +++ b/Python/remote_debug.h @@ -728,6 +728,7 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c } if (strstr(filename, substr)) { + PyErr_Clear(); retval = search_elf_file_for_section(handle, secname, start, path); if (retval) { break;