Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not raise an Exception when exiting pdb #124703

Closed
Labels
type-featureA feature request or enhancement
@gaogaotiantian

Description

@gaogaotiantian

Feature or enhancement

Proposal:

Currently, if you set abreakpoint() in your code, and exit withq orctrl+D, the output is just ugly:

Traceback (most recent call last):  File "/Users/gaotian/programs/cpython/example.py", line 11, in <module>    while True:          ^^^^  File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/bdb.py", line 90, in trace_dispatch    return self.dispatch_line(frame)           ^^^^^^^^^^^^^^^^^^^^^^^^^  File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/bdb.py", line 115, in dispatch_line    if self.quitting: raise BdbQuit                      ^^^^^^^^^^^^^bdb.BdbQuit

It makes no sense to print a trackback of an exception just because I want to quit pdb and stop debugging. Now that we have an indicator for inline mode, we can deal with this.

What I propose is - for inline mode debugging, any quit attempt(q,ctrl+D, etc.) will trigger a confirm prompt (likegdb orlldb), the user can say no and go back to debugging, or they can confirm and quit the program.

There are a few design details which I will list in the following PR.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp