summaryrefslogtreecommitdiff
path: root/pylint/extensions/broad_try_clause.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/extensions/broad_try_clause.py')
-rw-r--r--pylint/extensions/broad_try_clause.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/extensions/broad_try_clause.py b/pylint/extensions/broad_try_clause.py
index b460850c2..a45dc5fe6 100644
--- a/pylint/extensions/broad_try_clause.py
+++ b/pylint/extensions/broad_try_clause.py
@@ -10,12 +10,15 @@
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
"""Looks for try/except statements with too much code in the try clause."""
-from typing import Union
+from typing import TYPE_CHECKING, Union
from astroid import nodes
from pylint import checkers, interfaces
+if TYPE_CHECKING:
+ from pylint.lint import PyLinter
+
class BroadTryClauseChecker(checkers.BaseChecker):
"""Checks for try clauses with too many lines.
@@ -72,6 +75,5 @@ class BroadTryClauseChecker(checkers.BaseChecker):
self.visit_tryexcept(node)
-def register(linter):
- """Required method to auto register this checker."""
+def register(linter: "PyLinter") -> None:
linter.register_checker(BroadTryClauseChecker(linter))