mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-139940: Handle RuntimeError when attaching to a non-existing process in pdb. (#139941)
This commit is contained in:
parent
c41f84ff61
commit
058bc182b9
3 changed files with 20 additions and 1 deletions
|
|
@ -3577,7 +3577,13 @@ def main():
|
|||
parser.error("argument -m: not allowed with argument --pid")
|
||||
try:
|
||||
attach(opts.pid, opts.commands)
|
||||
except PermissionError as e:
|
||||
except RuntimeError:
|
||||
print(
|
||||
f"Cannot attach to pid {opts.pid}, please make sure that the process exists "
|
||||
"and is using the same Python version."
|
||||
)
|
||||
sys.exit(1)
|
||||
except PermissionError:
|
||||
exit_with_permission_help_text()
|
||||
return
|
||||
elif opts.module:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue