Paul Prescod's patches to allow the stack viewer to pop up when a
traceback is printed.
diff --git a/Tools/idle/Bindings.py b/Tools/idle/Bindings.py
index dbca89a..e365032 100644
--- a/Tools/idle/Bindings.py
+++ b/Tools/idle/Bindings.py
@@ -44,6 +44,7 @@
('_Go to file/line', '<<goto-file-line>>'),
('_Open stack viewer', '<<open-stack-viewer>>'),
('_Debugger toggle', '<<toggle-debugger>>'),
+ ('_JIT Stack viewer toggle', '<<toggle-jit-stack-viewer>>' ),
]),
('help', [
('_Help...', '<<help>>'),
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index 6df38c3..f484fb8 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -217,8 +217,13 @@
raise
else:
self.showtraceback()
+ if self.tkconsole.jit_stack_view:
+ self.tkconsole.open_stack_viewer()
except:
self.showtraceback()
+ if self.tkconsole.jit_stack_view:
+ self.tkconsole.open_stack_viewer()
+
finally:
self.tkconsole.endexecuting()
@@ -265,6 +270,7 @@
text.bind("<<open-stack-viewer>>", self.open_stack_viewer)
text.bind("<<toggle-debugger>>", self.toggle_debugger)
text.bind("<<open-python-shell>>", self.flist.open_shell)
+ text.bind("<<toggle-jit-stack-viewer>>", self.toggle_jit_stack_viewer)
sys.stdout = PseudoFile(self, "stdout")
sys.stderr = PseudoFile(self, "stderr")
@@ -290,6 +296,11 @@
else:
self.open_debugger()
+ jit_stack_view = 0
+
+ def toggle_jit_stack_viewer( self, event=None):
+ self.jit_stack_view = not self.jit_stack_view
+
def close_debugger(self):
db = self.interp.getdebugger()
if db: