summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2010-05-09 01:20:20 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2010-05-09 01:20:20 (GMT)
commit860852fdf434cb566ace9879ba2a6be0e2569765 (patch)
tree1702e4bbab8f31338c919fa32ae24c157569d927 /Lib/pdb.py
parent56fe6569fd5916c371c9075fec47973c74c34573 (diff)
downloadcpython-860852fdf434cb566ace9879ba2a6be0e2569765.zip
cpython-860852fdf434cb566ace9879ba2a6be0e2569765.tar.gz
cpython-860852fdf434cb566ace9879ba2a6be0e2569765.tar.bz2
Revert r81012. buildbot problems and its questionable of me to even
add this to trunk while we're on the way to 2.7rc1. When fixed this can go into py3k first. Sorry.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py44
1 files changed, 5 insertions, 39 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 1cd6706..0751c17 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -13,7 +13,6 @@ import os
import re
import pprint
import traceback
-import signal
class Restart(Exception):
@@ -73,8 +72,6 @@ class Pdb(bdb.Bdb, cmd.Cmd):
import readline
except ImportError:
pass
- self.allow_kbdint = False
- signal.signal(signal.SIGINT, self.sigint_handler)
# Read $HOME/.pdbrc and ./.pdbrc
self.rcLines = []
@@ -107,13 +104,6 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.commands_bnum = None # The breakpoint number for which we are
# defining a list
- def sigint_handler(self, signum, frame):
- if self.allow_kbdint:
- raise KeyboardInterrupt()
- print >>self.stdout, "\nProgram interrupted. (Use 'cont' to resume)."
- self.set_step()
- self.set_trace(frame)
-
def reset(self):
bdb.Bdb.reset(self)
self.forget()
@@ -186,7 +176,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if not self.commands_silent[currentbp]:
self.print_stack_entry(self.stack[self.curindex])
if self.commands_doprompt[currentbp]:
- self._cmdloop()
+ self.cmdloop()
self.forget()
return
return 1
@@ -209,22 +199,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.interaction(frame, exc_traceback)
# General interaction function
- def _cmdloop(self):
- while 1:
- try:
- # keyboard interrupts allow for an easy way to interrupt
- # the current command
- self.allow_kbdint = True
- self.cmdloop()
- self.allow_kbdint = False
- break
- except KeyboardInterrupt:
- print >>self.stdout, '--KeyboardInterrupt--'
def interaction(self, frame, traceback):
self.setup(frame, traceback)
self.print_stack_entry(self.stack[self.curindex])
- self._cmdloop()
+ self.cmdloop()
self.forget()
def displayhook(self, obj):
@@ -350,22 +329,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
prompt_back = self.prompt
self.prompt = '(com) '
self.commands_defining = True
- try:
- self.cmdloop()
- except (KeyboardInterrupt, IOError):
- # It appears that that when pdb is reading input from a pipe
- # we may get IOErrors, rather than KeyboardInterrupt.
- # Now discard all the commands entered so far (essentially undo
- # any effect of this "commands" cmd)
- self.commands.pop(bnum)
- self.commands_doprompt.pop(bnum)
- self.commands_silent.pop(bnum)
- # this will get caught by the _cmdloop and pdb will reenter
- # the main command loop
- raise KeyboardInterrupt()
- finally:
- self.commands_defining = False
- self.prompt = prompt_back
+ self.cmdloop()
+ self.commands_defining = False
+ self.prompt = prompt_back
def do_break(self, arg, temporary = 0):
# break [ ([filename:]lineno | function) [, "condition"] ]