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

gh-106670: Allow Pdb to move between chained exceptions#106676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 12 commits intopython:mainfromCarreau:gh-106670
Aug 28, 2023
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Move back MAX_CHAINED_EXCEPTION_DEPTH to class variable
  • Loading branch information
@Carreau
Carreau committedAug 24, 2023
commit66a39443aa4e8c35d07f6439ff4510ecb16d1351
9 changes: 6 additions & 3 deletionsLib/pdb.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -206,13 +206,16 @@ def namespace(self):
# line_prefix = ': ' # Use this to get the old situation back
line_prefix = '\n-> ' # Probably a better default

MAX_CHAINED_EXCEPTION_DEPTH = 999


class Pdb(bdb.Bdb, cmd.Cmd):
# the max number of chained exceptions + exception groups we accept to navigate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is this comment in the right place?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

moved and rephrased.

_previous_sigint_handler = None

# Limit the maximum depth of chained exceptions, we should be handling cycles,
# but in case there are recursions, we stop at 999.
MAX_CHAINED_EXCEPTION_DEPTH = 999

def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None,
nosigint=False, readrc=True):
bdb.Bdb.__init__(self, skip=skip)
Expand DownExpand Up@@ -446,9 +449,9 @@ def _get_tb_and_exceptions(self, tb_or_exc):
):
current = current.__context__

if len(_exceptions) >= MAX_CHAINED_EXCEPTION_DEPTH:
if len(_exceptions) >=self.MAX_CHAINED_EXCEPTION_DEPTH:
self.message(
f"More than {MAX_CHAINED_EXCEPTION_DEPTH}"
f"More than {self.MAX_CHAINED_EXCEPTION_DEPTH}"
" chained exceptions found, not all exceptions"
"will be browsable with `exceptions`."
)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp