Example #1
0
 def _check_except_count(self, node: ast.Try) -> None:
     if len(node.handlers) > constants.MAX_EXCEPT_CASES:
         self.add_violation(
             complexity.TooManyExceptCasesViolation(
                 node,
                 text=str(len(node.handlers)),
                 baseline=constants.MAX_EXCEPT_CASES,
             ), )
Example #2
0
 def _check_except_count(self, node: ast.Try) -> None:
     if len(node.handlers) > self._max_except_cases:
         self.add_violation(
             complexity.TooManyExceptCasesViolation(
                 node,
                 text=str(len(node.handlers)),
                 baseline=self._max_except_cases,
             ),
         )