Display a call stack and exception traceback. This allows the user to probe the contents of any frame in the given stack. *frame* may either be a Frame instance or None, in which case the current frame is retrieved from ``sys._getframe()``. If *tb* is provided th
(self, frame=None, expand=True, lastFrame=None)
| 46 | items[0].setExpanded(True) |
| 47 | |
| 48 | def setStack(self, frame=None, expand=True, lastFrame=None): |
| 49 | """Display a call stack and exception traceback. |
| 50 | |
| 51 | This allows the user to probe the contents of any frame in the given stack. |
| 52 | |
| 53 | *frame* may either be a Frame instance or None, in which case the current |
| 54 | frame is retrieved from ``sys._getframe()``. |
| 55 | |
| 56 | If *tb* is provided then the frames in the traceback will be appended to |
| 57 | the end of the stack list. If *tb* is None, then sys.exc_info() will |
| 58 | be checked instead. |
| 59 | """ |
| 60 | if frame is None: |
| 61 | frame = sys._getframe().f_back |
| 62 | |
| 63 | self.clear() |
| 64 | |
| 65 | stack = stackFromFrame(frame, lastFrame=lastFrame) |
| 66 | items = makeItemTree(stack, "Call stack") |
| 67 | self.addTopLevelItem(items[0]) |
| 68 | if expand: |
| 69 | items[0].setExpanded(True) |
| 70 | |
| 71 | |
| 72 | def stackFromFrame(frame, lastFrame=None): |
nothing calls this directly
no test coverage detected