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