##// END OF EJS Templates
some extra keyboardinterrupt catching, and raw_input in crash handler (which typically disappears without trace on win32
vivainio -
Show More
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2 """sys.excepthook for IPython itself, leaves a detailed report on disk.
3 3
4 $Id: CrashHandler.py 1828 2006-10-16 02:04:33Z fptest $"""
4 $Id: CrashHandler.py 2908 2007-12-30 21:07:46Z vivainio $"""
5 5
6 6 #*****************************************************************************
7 7 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -154,6 +154,7 b' $self.bug_tracker'
154 154 # Construct report on disk
155 155 report.write(self.make_report(traceback))
156 156 report.close()
157 raw_input("Press enter to exit:")
157 158
158 159 def make_report(self,traceback):
159 160 """Return a string containing a crash report."""
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6 6
7 7 This file contains all the classes and helper functions specific to IPython.
8 8
9 $Id: iplib.py 2899 2007-12-28 08:32:59Z fperez $
9 $Id: iplib.py 2908 2007-12-30 21:07:46Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
@@ -218,7 +218,6 b' class InteractiveShell(object,Magic):'
218 218 for ns in (user_ns,user_global_ns):
219 219 if ns is not None and type(ns) != types.DictType:
220 220 raise TypeError,'namespace must be a dictionary'
221
222 221 # Job manager (for jobs run as background threads)
223 222 self.jobs = BackgroundJobManager()
224 223
@@ -1551,7 +1550,13 b' want to merge them back into the new files.""" % locals()'
1551 1550 else:
1552 1551 banner = self.BANNER+self.banner2
1553 1552
1554 self.interact(banner)
1553 while 1:
1554 try:
1555 self.interact(banner)
1556 except KeyboardInterrupt:
1557 # this should not be necessary, but KeyboardInterrupt
1558 # handling seems rather unpredictable...
1559 self.write("\nKeyboardInterrupt in interact()\n")
1555 1560
1556 1561 def exec_init_cmd(self):
1557 1562 """Execute a command given at the command line.
@@ -1682,14 +1687,18 b' want to merge them back into the new files.""" % locals()'
1682 1687 self.rl_do_indent = False
1683 1688
1684 1689 except KeyboardInterrupt:
1685 self.write('\nKeyboardInterrupt\n')
1686 self.resetbuffer()
1687 # keep cache in sync with the prompt counter:
1688 self.outputcache.prompt_count -= 1
1689
1690 if self.autoindent:
1691 self.indent_current_nsp = 0
1692 more = 0
1690 #double-guard against keyboardinterrupts during kbdint handling
1691 try:
1692 self.write('\nKeyboardInterrupt\n')
1693 self.resetbuffer()
1694 # keep cache in sync with the prompt counter:
1695 self.outputcache.prompt_count -= 1
1696
1697 if self.autoindent:
1698 self.indent_current_nsp = 0
1699 more = 0
1700 except KeyboardInterrupt:
1701 pass
1693 1702 except EOFError:
1694 1703 if self.autoindent:
1695 1704 self.rl_do_indent = False
@@ -60,7 +60,7 b' You can implement other color schemes easily, the syntax is fairly'
60 60 self-explanatory. Please send back new schemes you develop to the author for
61 61 possible inclusion in future releases.
62 62
63 $Id: ultraTB.py 2907 2007-12-30 20:33:06Z vivainio $"""
63 $Id: ultraTB.py 2908 2007-12-30 21:07:46Z vivainio $"""
64 64
65 65 #*****************************************************************************
66 66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
@@ -869,7 +869,7 b' class VerboseTB(TBTools):'
869 869 try:
870 870 self.debugger()
871 871 except KeyboardInterrupt:
872 print "KeyboardInterrupt"
872 print "\nKeyboardInterrupt"
873 873
874 874 #----------------------------------------------------------------------------
875 875 class FormattedTB(VerboseTB,ListTB):
@@ -987,7 +987,7 b' class AutoFormattedTB(FormattedTB):'
987 987 try:
988 988 self.debugger()
989 989 except KeyboardInterrupt:
990 print "KeyboardInterrupt"
990 print "\nKeyboardInterrupt"
991 991
992 992 def text(self,etype=None,value=None,tb=None,context=5,mode=None):
993 993 if etype is None:
General Comments 0
You need to be logged in to leave comments. Login now