code: def __init__(self, exc, flist=None):
      self.flist = flist
      self.stack = self.get_stack(
          None if exc is None else exc.__traceback__
      )
      self.text = f"{type(exc).__name__}: {str(exc)}"
  
imports: import linecache
  import os
  import tkinter
  from idlelib.debugobj import ObjectTreeItem, make_objecttreeitem
  from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas
label_desc: Use image node_id 1 to create a new StackTreeItem object from inherited base classes: TreeItem with example: obj = StackTreeItem(exc, flist)