'Try to obtain the Frame for the python-related code in the selected
frame, or None'

@classmethod
def get_selected_python_frame(cls):

    try:
        frame = cls.get_selected_frame()
    except gdb.error:
        return None
    while frame:
        if frame.is_python_frame():
            return frame
        frame = frame.older()
    return None
