diff options
Diffstat (limited to 'pylint/checkers/exceptions.py')
-rw-r--r-- | pylint/checkers/exceptions.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index b9b6ceb04..0d60b0a39 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -36,7 +36,7 @@ """Checks for various exception related errors.""" import builtins import inspect -from typing import Any, List, Optional +from typing import TYPE_CHECKING, Any, List, Optional import astroid from astroid import nodes, objects @@ -44,6 +44,9 @@ from astroid import nodes, objects from pylint import checkers, interfaces from pylint.checkers import utils +if TYPE_CHECKING: + from pylint.lint import PyLinter + def _builtin_exceptions(): def predicate(obj): @@ -571,6 +574,5 @@ class ExceptionsChecker(checkers.BaseChecker): exceptions_classes += [exc for _, exc in exceptions] -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(ExceptionsChecker(linter)) |