##// END OF EJS Templates
Merge pull request #2544 from bfroehle/tracer_recursion...
Bradley M. Froehle -
r8955:ca398153 merge
parent child Browse files
Show More
@@ -27,6 +27,7 b' http://www.python.org/2.2.3/license.html"""'
27 27 from __future__ import print_function
28 28
29 29 import bdb
30 import functools
30 31 import linecache
31 32 import sys
32 33
@@ -59,10 +60,18 b' else:'
59 60 # Allow the set_trace code to operate outside of an ipython instance, even if
60 61 # it does so with some limitations. The rest of this support is implemented in
61 62 # the Tracer constructor.
62 def BdbQuit_excepthook(et,ev,tb):
63 def BdbQuit_excepthook(et, ev, tb, excepthook=None):
64 """Exception hook which handles `BdbQuit` exceptions.
65
66 All other exceptions are processed using the `excepthook`
67 parameter.
68 """
63 69 if et==bdb.BdbQuit:
64 70 print('Exiting Debugger.')
71 elif excepthook is not None:
72 excepthook(et, ev, tb)
65 73 else:
74 # Backwards compatibility. Raise deprecation warning?
66 75 BdbQuit_excepthook.excepthook_ori(et,ev,tb)
67 76
68 77 def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None):
@@ -108,8 +117,8 b' class Tracer(object):'
108 117 ip = get_ipython()
109 118 except NameError:
110 119 # Outside of ipython, we set our own exception hook manually
111 BdbQuit_excepthook.excepthook_ori = sys.excepthook
112 sys.excepthook = BdbQuit_excepthook
120 sys.excepthook = functools.partial(BdbQuit_excepthook,
121 excepthook=sys.excepthook)
113 122 def_colors = 'NoColor'
114 123 try:
115 124 # Limited tab completion support
General Comments 0
You need to be logged in to leave comments. Login now