We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a042a8 commit 86c7fd9Copy full SHA for 86c7fd9
pylint/extensions/broad_try_clause.py
@@ -10,6 +10,7 @@
10
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
11
12
"""Looks for try/except statements with too much code in the try clause."""
13
+from typing import Union
14
15
from astroid import nodes
16
@@ -59,7 +60,7 @@ def _count_statements(self, try_node):
59
60
61
return statement_count
62
- def visit_tryexcept(self, node: nodes.TryExcept) -> None:
63
+ def visit_tryexcept(self, node: Union[nodes.TryExcept, nodes.TryFinally]) -> None:
64
try_clause_statements = self._count_statements(node)
65
if try_clause_statements > self.config.max_try_statements:
66
msg = f"try clause contains {try_clause_statements} statements, expected at most {self.config.max_try_statements}"
0 commit comments