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

Commitb2f6e85

Browse files
committed
Adresse secodn round of review
1 parentdbd0b7b commitb2f6e85

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

‎Doc/library/pdb.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,15 @@ can be overridden by the local file.
639639

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

642-
..pdbcommand::exceptions [arg]
642+
..pdbcommand::exceptions [excnumber]
643643

644644
List or jump between chained exceptions.
645645

646-
If ``Pdb.post_mortem()`` is called with a chained exception, it will now allow
647-
the user to move between the chained exceptions using ``exceptions`` command to
648-
list exceptions, and ``exception <number>`` to switch to that exception.
646+
When using ``pdb.pm()`` or ``Pdb.post_mortem(...)`` with a chained exception
647+
instead of a traceback, it will now allow the user to move between the
648+
chained exceptions using ``exceptions`` command to list exceptions, and
649+
``exception <number>`` to switch to that exception.
650+
649651

650652
Example::
651653

‎Lib/pdb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ def preloop(self):
416416
self.message('display %s: %r [old: %r]'%
417417
(expr,newvalue,oldvalue))
418418

419-
definteraction(self,frame,traceback):
419+
definteraction(self,frame,tb_or_exc):
420420
# Restore the previous signal handler at the Pdb prompt.
421421

422-
ifisinstance(traceback,BaseException):
423-
traceback,exception=traceback.__traceback__,traceback
422+
ifisinstance(tb_or_exc,BaseException):
423+
tb_or_exc,exception=tb_or_exc.__traceback__,tb_or_exc
424424
self._chained_exceptions= [exception]
425425
current=exception
426426
whilecurrent:=current.__context__:
@@ -436,7 +436,7 @@ def interaction(self, frame, traceback):
436436
pass
437437
else:
438438
Pdb._previous_sigint_handler=None
439-
ifself.setup(frame,traceback):
439+
ifself.setup(frame,tb_or_exc):
440440
# no interaction desired at this time (happens if .pdbrc contains
441441
# a command like "continue")
442442
self.forget()
@@ -1087,7 +1087,7 @@ def _select_frame(self, number):
10871087
self.lineno=None
10881088

10891089
defdo_exceptions(self,arg):
1090-
ifnotargorarg=="list":
1090+
ifnotarg:
10911091
forix,excinenumerate(self._chained_exceptions):
10921092
prompt=">"ifix==self._chained_exception_indexelse" "
10931093
self.message(f"{prompt}{ix}{exc!r}")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp