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
Show file tree
Hide file tree
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
Adress some of the reviews
  • Loading branch information
@Carreau
Carreau committedAug 26, 2023
commite3b9e4ab09c56d56c6c980d01cabcfc8caef555d
1 change: 1 addition & 0 deletionsDoc/library/pdb.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -639,6 +639,7 @@ can be overridden by the local file.

Print the return value for the last return of the current function.

.. versionadded:: 3.7
.. pdbcommand:: exceptions [excnumber]

List or jump between chained exceptions.
Expand Down
16 changes: 8 additions & 8 deletionsLib/pdb.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ def namespace(self):


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

# Limit the maximum depth of chained exceptions, we should be handling cycles,
Expand DownExpand Up@@ -483,15 +482,16 @@ def _hold_exceptions(self, exceptions):

def interaction(self, frame, tb_or_exc):
# Restore the previous signal handler at the Pdb prompt.
if Pdb._previous_sigint_handler:
try:
signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
except ValueError: # ValueError: signal only works in main thread
pass
else:
Pdb._previous_sigint_handler = None

_chained_exceptions, tb = self._get_tb_and_exceptions(tb_or_exc)
with self._hold_exceptions(_chained_exceptions):
if Pdb._previous_sigint_handler:
try:
signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
except ValueError: # ValueError: signal only works in main thread
pass
else:
Pdb._previous_sigint_handler = None
if self.setup(frame, tb):
# no interaction desired at this time (happens if .pdbrc contains
# a command like "continue")
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp