Show More
@@ -59,11 +59,11 b' else:' | |||
|
59 | 59 | # Allow the set_trace code to operate outside of an ipython instance, even if |
|
60 | 60 | # it does so with some limitations. The rest of this support is implemented in |
|
61 | 61 | # the Tracer constructor. |
|
62 | def BdbQuit_excepthook(et,ev,tb): | |
|
62 | def BdbQuit_excepthook(et,ev,tb,orig_hook): | |
|
63 | 63 | if et==bdb.BdbQuit: |
|
64 | 64 | print('Exiting Debugger.') |
|
65 | 65 | else: |
|
66 |
|
|
|
66 | orig_hook(et,ev,tb) | |
|
67 | 67 | |
|
68 | 68 | def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None): |
|
69 | 69 | print('Exiting Debugger.') |
@@ -108,8 +108,8 b' class Tracer(object):' | |||
|
108 | 108 | ip = get_ipython() |
|
109 | 109 | except NameError: |
|
110 | 110 | # Outside of ipython, we set our own exception hook manually |
|
111 | BdbQuit_excepthook.excepthook_ori = sys.excepthook | |
|
112 |
|
|
|
111 | sys.excepthook = lambda et, ev, tb, orig_hook=sys.excepthook: \ | |
|
112 | BdbQuit_excepthook(et, ev, tb, orig_hook) | |
|
113 | 113 | def_colors = 'NoColor' |
|
114 | 114 | try: |
|
115 | 115 | # Limited tab completion support |
@@ -136,7 +136,7 b' class Tracer(object):' | |||
|
136 | 136 | except: |
|
137 | 137 | # This is only a user-facing convenience, so any error we encounter |
|
138 | 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 | 140 | import traceback |
|
141 | 141 | traceback.print_exc() |
|
142 | 142 | |
@@ -423,7 +423,7 b' class Pdb(OldPdb):' | |||
|
423 | 423 | src = [] |
|
424 | 424 | if filename == "<string>" and hasattr(self, "_exec_filename"): |
|
425 | 425 | filename = self._exec_filename |
|
426 | ||
|
426 | ||
|
427 | 427 | for lineno in range(first, last+1): |
|
428 | 428 | line = ulinecache.getline(filename, lineno) |
|
429 | 429 | if not line: |
General Comments 0
You need to be logged in to leave comments.
Login now