Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6c3f25

Browse files
committed
react to interrupts differently
1 parent bba77af commit d6c3f25

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/pdb.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# - Where and when to stop exactly when 'next' encounters a return?
1010
# (should be level-based -- don't trace anything deeper than current)
1111
# - Show stack traces upside-down (like dbx/gdb)
12+
# - When stopping on an exception, show traceback stack
13+
# - Merge with tb (for post-mortem usage)
1214

1315
import string
1416
import sys
@@ -120,6 +122,9 @@ def dispatch(self, frame, where, arg):
120122
if self.botframe is None:
121123
self.botframe = frame
122124
if where == 'exception':
125+
if self.whatnext == 'continue' and \
126+
arg[0] is not KeyboardInterrupt:
127+
return self.trace
123128
stop = 1
124129
elif self.whatnext == 'continue':
125130
stop = 0

0 commit comments

Comments
 (0)