This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients can.ibanoglu, markroseman, terry.reedy
Date 2015-08-18.17:10:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439917843.22.0.545538804814.issue24790@psf.upfronthosting.co.za>
In-reply-to
Content
StackViewer.py seem to be identical in 3.4, 3.5, and 3.6, so a patch against any applies to all.  The diff with 2.7 is

F:\Python\dev\36>hg diff -r 4884af6d3e30 f:/python/dev/36/Lib/idlelib/StackViewer.py
@@ -2,7 +2,7 @@
 import sys
 import linecache
 import re
-import Tkinter as tk
+import tkinter as tk

 from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
 from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
@@ -10,7 +10,7 @@

 def StackBrowser(root, flist=None, tb=None, top=None):
     if top is None:
-        from Tkinter import Toplevel
+        from tkinter import Toplevel
         top = Toplevel(root)
     sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
     sc.frame.pack(expand=1, fill="both")
@@ -109,7 +109,7 @@
         return len(self.object) > 0

     def keys(self):
-        return self.object.keys()
+        return list(self.object.keys())

     def GetSubList(self):
         sublist = []

The second and third differences are due to unneeded code; I will remove them after I submit this message, so update your repository after I do that and then patch.

---
Your research is very helpful.  The purpose of 1. *is* to remove data ;-) -- data that is only present because of Idle.  The purpose of  StackTreeItem.get_stack is to removed unneeded data while converting a linked list to a regular list.  Note that the loop drops 2 of 4 fields. I do not know if
        if tb and tb.tb_frame is None:
            tb = tb.tb_next
actually removes anything, but after this, I believe that the idlelib.run.runcode node (or idlelib.PyShell.runcode node, when Idle is started with -n) is at the top of the linked list.  So I believe adding
        tb = tb.tb_next
after the above will do what we want.  Try it, and if it works, move on.

---
6 (modeled after 3). Modules only have +Globals.  Remove +Globals under each module and instead display globals when expanding. (There will only be a module other than __main__ when there is an error in another module being imported.  We should then improve the lines to read
  + Globals for module __main__ ...
  + Locals for function xyz...
History
Date User Action Args
2015-08-18 17:10:43terry.reedysetrecipients: + terry.reedy, markroseman, can.ibanoglu
2015-08-18 17:10:43terry.reedysetmessageid: <1439917843.22.0.545538804814.issue24790@psf.upfronthosting.co.za>
2015-08-18 17:10:43terry.reedylinkissue24790 messages
2015-08-18 17:10:42terry.reedycreate