def _check_loop_needs_else(self, node: _AnyLoop) -> None:
     if node.orelse and not self._has_break(node):
         self.add_violation(UselessLoopElseViolation(node))
Ejemplo n.º 2
0
 def _check_loop_needs_else(self, node: AnyLoop) -> None:
     if node.orelse and not loops.has_break(node,
                                            break_nodes=(ast.Break, )):
         self.add_violation(UselessLoopElseViolation(node))