def _check_else_on_loop(self, node):
    'Check that any loop with an else clause has a break statement.'
    if (node.orelse and (not _loop_exits_early(node))):
        self.add_message('useless-else-on-loop', node=node, line=(node.orelse[0].lineno - 1))
Check that any loop with an else clause has a break statement.
def _check_else_on_loop(self, node):
    
    if (node.orelse and (not _loop_exits_early(node))):
        self.add_message('useless-else-on-loop', node=node, line=(node.orelse[0].lineno - 1))