def update_stack(self):

    def make_frame_ui(frame_lineno):
        (frame, lineno) = frame_lineno
        code = frame.f_code
        class_name = None
        if (code.co_argcount and (code.co_varnames[0] == 'self')):
            try:
                class_name = frame.f_locals['self'].__class__.__name__
            except Exception:
                from pudb.lowlevel import ui_log
                message = 'Failed to determine class name'
                ui_log.exception(message)
                class_name = ('!! %s !!' % message)
        return StackFrame((frame is self.debugger.curframe), code.co_name, class_name, self._format_fname(code.co_filename), lineno)
    frame_uis = [make_frame_ui(fl) for fl in self.debugger.stack]
    if (CONFIG['current_stack_frame'] == 'top'):
        frame_uis = frame_uis[::(- 1)]
    elif (CONFIG['current_stack_frame'] == 'bottom'):
        pass
    else:
        raise ValueError("invalid value for 'current_stack_frame' pref")
    self.stack_walker[:] = frame_uis
def update_stack(self):

    def make_frame_ui(frame_lineno):
        (frame, lineno) = frame_lineno
        code = frame.f_code
        class_name = None
        if (code.co_argcount and (code.co_varnames[0] == 'self')):
            try:
                class_name = frame.f_locals['self'].__class__.__name__
            except Exception:
                from pudb.lowlevel import ui_log
                message = 'Failed to determine class name'
                ui_log.exception(message)
                class_name = ('!! %s !!' % message)
        return StackFrame((frame is self.debugger.curframe), code.co_name, class_name, self._format_fname(code.co_filename), lineno)
    frame_uis = [make_frame_ui(fl) for fl in self.debugger.stack]
    if (CONFIG['current_stack_frame'] == 'top'):
        frame_uis = frame_uis[::(- 1)]
    elif (CONFIG['current_stack_frame'] == 'bottom'):
        pass
    else:
        raise ValueError("invalid value for 'current_stack_frame' pref")
    self.stack_walker[:] = frame_uis