()
return prev_frame
Return previous stack frame of where this func is called.
Return previous stack frame of where this func is called.
Return previous stack frame of where this func is called .
def _prev_frame() -> FrameType:
    """Return previous stack frame of where this func is called."""
    this_frame = inspect.currentframe()
    if not this_frame:
        sys.exit(
            "ERROR: Ward requires an interpreter with Python stack frame support\n"
        )
    caller_frame = this_frame.f_back
    assert caller_frame, "the frame where _prev_frame was called must exist"
    prev_frame = caller_frame.f_back
    assert prev_frame, "can not call _prev_frame in bottom stack frame"
    return prev_frame
def _prev_frame ( ) -> FrameType : this_frame = inspect . currentframe ( ) if not this_frame : sys . exit ( "ERROR: Ward requires an interpreter with Python stack frame support\n" ) caller_frame = this_frame . f_back assert caller_frame , "the frame where _prev_frame was called must exist" prev_frame = caller_frame . f_back assert prev_frame , "can not call _prev_frame in bottom stack frame" return prev_frame