module documentation

Checks for various exception related errors.

Class BaseVisitor Base class for visitors defined in this module.
Class ExceptionRaiseLeafVisitor Visitor for handling leaf kinds of a raise value.
Class ExceptionRaiseRefVisitor Visit references (anything that is not an AST leaf).
Class ExceptionsChecker Exception related checks.
Function register Undocumented
Constant MSGS Undocumented
Function _annotated_unpack_infer Recursively generate nodes inferred by the given statement.
Function _builtin_exceptions Undocumented
Function _is_raising Return whether the given statement node raises an exception.
def register(linter: PyLinter): (source)

Undocumented

Undocumented

Value
{'E0701': ('Bad except clauses order (%s)',
           'bad-except-order',
           'Used when except clauses are not in the correct order (from the more
 specific to the more generic). If you don\'t fix the order, some exceptions may
 not be caught by the most specific handler.'),
 'E0702': ('Raising %s while only classes or instances are allowed',
           'raising-bad-type',
...

Recursively generate nodes inferred by the given statement. If the inferred value is a list or a tuple, recurse on the elements. Returns an iterator which yields tuples in the format ('original node', 'inferred node').

def _builtin_exceptions() -> set[str]: (source)

Undocumented

def _is_raising(body: list[nodes.NodeNG]) -> bool: (source)

Return whether the given statement node raises an exception.