summaryrefslogtreecommitdiff
path: root/pylint/extensions/overlapping_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/extensions/overlapping_exceptions.py')
-rw-r--r--pylint/extensions/overlapping_exceptions.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/extensions/overlapping_exceptions.py b/pylint/extensions/overlapping_exceptions.py
index 470582b68..ef6afefea 100644
--- a/pylint/extensions/overlapping_exceptions.py
+++ b/pylint/extensions/overlapping_exceptions.py
@@ -3,7 +3,7 @@
"""Looks for overlapping exceptions."""
-from typing import Any, List, Tuple
+from typing import TYPE_CHECKING, Any, List, Tuple
import astroid
from astroid import nodes
@@ -12,6 +12,9 @@ from pylint import checkers, interfaces
from pylint.checkers import utils
from pylint.checkers.exceptions import _annotated_unpack_infer
+if TYPE_CHECKING:
+ from pylint.lint import PyLinter
+
class OverlappingExceptionsChecker(checkers.BaseChecker):
"""Checks for two or more exceptions in the same exception handler
@@ -81,6 +84,5 @@ class OverlappingExceptionsChecker(checkers.BaseChecker):
handled_in_clause += [(part, exc)]
-def register(linter):
- """Required method to auto register this checker."""
+def register(linter: "PyLinter") -> None:
linter.register_checker(OverlappingExceptionsChecker(linter))