def interaction(self, frame, exc_tuple=None, show_exc_dialog=True):
    if (exc_tuple is None):
        tb = None
    elif isinstance(exc_tuple, TracebackType):
        tb = exc_tuple
        (exc,) = (exc for exc in gc.get_referrers(tb) if (getattr(exc, '__traceback__', None) is tb))
        exc_tuple = (type(exc), exc, tb)
    else:
        tb = exc_tuple[2]
    if ((frame is None) and (tb is not None)):
        frame = tb.tb_frame
    found_bottom_frame = False
    walk_frame = frame
    while True:
        if (walk_frame is self.bottom_frame):
            found_bottom_frame = True
            break
        if (walk_frame is None):
            break
        walk_frame = walk_frame.f_back
    if ((not found_bottom_frame) and (not self.post_mortem)):
        return
    (self.stack, index) = self.get_shortened_stack(frame, tb)
    if self.post_mortem:
        index = (len(self.stack) - 1)
    self.set_frame_index(index)
    self.ui.call_with_ui(self.ui.interaction, exc_tuple, show_exc_dialog=show_exc_dialog)
def interaction(self, frame, exc_tuple=None, show_exc_dialog=True):
    if (exc_tuple is None):
        tb = None
    elif isinstance(exc_tuple, TracebackType):
        tb = exc_tuple
        (exc,) = (exc for exc in gc.get_referrers(tb) if (getattr(exc, '__traceback__', None) is tb))
        exc_tuple = (type(exc), exc, tb)
    else:
        tb = exc_tuple[2]
    if ((frame is None) and (tb is not None)):
        frame = tb.tb_frame
    found_bottom_frame = False
    walk_frame = frame
    while True:
        if (walk_frame is self.bottom_frame):
            found_bottom_frame = True
            break
        if (walk_frame is None):
            break
        walk_frame = walk_frame.f_back
    if ((not found_bottom_frame) and (not self.post_mortem)):
        return
    (self.stack, index) = self.get_shortened_stack(frame, tb)
    if self.post_mortem:
        index = (len(self.stack) - 1)
    self.set_frame_index(index)
    self.ui.call_with_ui(self.ui.interaction, exc_tuple, show_exc_dialog=show_exc_dialog)