summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-04 17:11:36 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-04 17:11:36 (GMT)
commit34748cd6a86a423d4c0fd65af0834c8cfbb1db40 (patch)
treee471441cb7f28df1fce97c3e4c1450745d54f335 /Lib/doctest.py
parentf3fa5685e85f7aa21c124bb6a71a076f80666f2c (diff)
downloadcpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.zip
cpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.tar.gz
cpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.tar.bz2
Fix test suite to not activate new sigint behavior in pdb.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 5d186b5..b79db17 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -318,7 +318,8 @@ class _OutputRedirectingPdb(pdb.Pdb):
def __init__(self, out):
self.__out = out
self.__debugger_used = False
- pdb.Pdb.__init__(self, stdout=out)
+ # do not play signal games in the pdb
+ pdb.Pdb.__init__(self, stdout=out, nosigint=True)
# still use input() to get user input
self.use_rawinput = 1
@@ -2528,14 +2529,16 @@ def debug_script(src, pm=False, globs=None):
exec(f.read(), globs, globs)
except:
print(sys.exc_info()[1])
- pdb.post_mortem(sys.exc_info()[2])
+ p = pdb.Pdb(nosigint=True)
+ p.reset()
+ p.interaction(None, sys.exc_info()[2])
else:
fp = open(srcfilename)
try:
script = fp.read()
finally:
fp.close()
- pdb.run("exec(%r)" % script, globs, globs)
+ pdb.Pdb(nosigint=True).run("exec(%r)" % script, globs, globs)
finally:
os.remove(srcfilename)