Skip to content

Commit c13a74d

Browse files
committed
fixup! Improve ReadRemoteMemory error handling on macOS
1 parent 7832a7d commit c13a74d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/remote_debug.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ extern "C" {
5454
# include <mach/mach.h>
5555
# include <mach/mach_vm.h>
5656
# include <mach/machine.h>
57+
# include <mach/task_info.h>
5758
# include <sys/mman.h>
5859
# include <sys/proc.h>
5960
# include <sys/sysctl.h>
@@ -1061,7 +1062,7 @@ _Py_RemoteDebug_ReadRemoteMemory(proc_handle_t *handle, uintptr_t remote_address
10611062
"0x%lx (size %zu): insufficient permissions",
10621063
handle->pid, remote_address, len);
10631064
break;
1064-
case KERN_INVALID_ARGUMENT:
1065+
case KERN_INVALID_ARGUMENT: {
10651066
// Perform a task_info check to see if the invalid argument is due
10661067
// to the process being terminated
10671068
task_basic_info_data_t task_basic_info;
@@ -1080,6 +1081,7 @@ _Py_RemoteDebug_ReadRemoteMemory(proc_handle_t *handle, uintptr_t remote_address
10801081
handle->pid, remote_address, len);
10811082
}
10821083
break;
1084+
}
10831085
case KERN_NO_SPACE:
10841086
case KERN_MEMORY_ERROR:
10851087
PyErr_Format(PyExc_ProcessLookupError,

0 commit comments

Comments
 (0)