##// END OF EJS Templates
Fixed infinite loop on exit in the event of where multiple debuggers have been attached an there is an uncaught exception. I am in the process of submitting a similar patch for ipdb.
DamianHeard -
Show More
@@ -59,11 +59,11 b' else:'
59 # Allow the set_trace code to operate outside of an ipython instance, even if
59 # Allow the set_trace code to operate outside of an ipython instance, even if
60 # it does so with some limitations. The rest of this support is implemented in
60 # it does so with some limitations. The rest of this support is implemented in
61 # the Tracer constructor.
61 # the Tracer constructor.
62 def BdbQuit_excepthook(et,ev,tb):
62 def BdbQuit_excepthook(et,ev,tb,orig_hook):
63 if et==bdb.BdbQuit:
63 if et==bdb.BdbQuit:
64 print('Exiting Debugger.')
64 print('Exiting Debugger.')
65 else:
65 else:
66 BdbQuit_excepthook.excepthook_ori(et,ev,tb)
66 orig_hook(et,ev,tb)
67
67
68 def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None):
68 def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None):
69 print('Exiting Debugger.')
69 print('Exiting Debugger.')
@@ -108,8 +108,8 b' class Tracer(object):'
108 ip = get_ipython()
108 ip = get_ipython()
109 except NameError:
109 except NameError:
110 # Outside of ipython, we set our own exception hook manually
110 # Outside of ipython, we set our own exception hook manually
111 BdbQuit_excepthook.excepthook_ori = sys.excepthook
111 sys.excepthook = lambda et, ev, tb, orig_hook=sys.excepthook: \
112 sys.excepthook = BdbQuit_excepthook
112 BdbQuit_excepthook(et, ev, tb, orig_hook)
113 def_colors = 'NoColor'
113 def_colors = 'NoColor'
114 try:
114 try:
115 # Limited tab completion support
115 # Limited tab completion support
@@ -136,7 +136,7 b' class Tracer(object):'
136 except:
136 except:
137 # This is only a user-facing convenience, so any error we encounter
137 # This is only a user-facing convenience, so any error we encounter
138 # here can be warned about but can be otherwise ignored. These
138 # here can be warned about but can be otherwise ignored. These
139 # printouts will tell us about problems if this API changes
139 # printouts will tell us about problems if this API changes
140 import traceback
140 import traceback
141 traceback.print_exc()
141 traceback.print_exc()
142
142
@@ -423,7 +423,7 b' class Pdb(OldPdb):'
423 src = []
423 src = []
424 if filename == "<string>" and hasattr(self, "_exec_filename"):
424 if filename == "<string>" and hasattr(self, "_exec_filename"):
425 filename = self._exec_filename
425 filename = self._exec_filename
426
426
427 for lineno in range(first, last+1):
427 for lineno in range(first, last+1):
428 line = ulinecache.getline(filename, lineno)
428 line = ulinecache.getline(filename, lineno)
429 if not line:
429 if not line:
General Comments 0
You need to be logged in to leave comments. Login now