File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,20 @@ def _print_cycle_exception(exception: CycleFoundException):
194
194
print (f"cycle: { inames } " , file = sys .stderr )
195
195
196
196
197
+ def exit_with_permission_help_text ():
198
+ """
199
+ Prints a message pointing to platform-specific permission help text and exits the program.
200
+ This function is called when a PermissionError is encountered while trying
201
+ to attach to a process.
202
+ """
203
+ print (
204
+ "Error: The specified process cannot be attached to due to insufficient permissions.\n "
205
+ "See the Python documentation for details on required privileges and troubleshooting:\n "
206
+ "https://docs.python.org/3.14/howto/remote_debugging.html#permission-requirements\n "
207
+ )
208
+ sys .exit (1 )
209
+
210
+
197
211
def _get_awaited_by_tasks (pid : int ) -> list :
198
212
try :
199
213
return get_all_awaited_by (pid )
@@ -202,6 +216,8 @@ def _get_awaited_by_tasks(pid: int) -> list:
202
216
e = e .__context__
203
217
print (f"Error retrieving tasks: { e } " )
204
218
sys .exit (1 )
219
+ except PermissionError as e :
220
+ exit_with_permission_help_text ()
205
221
206
222
207
223
def display_awaited_by_tasks_table (pid : int ) -> None :
You can’t perform that action at this time.
0 commit comments