Path 1: 851 calls (0.97)

Name (262) Attribute (202) Import (130) ImportFrom (121) Raise (116) Call (6) AssignName (6) DelName (4) BinOp (3) DelAttr (1)

NameError def (272) ImportError def (251) AttributeError def (203) 'RuntimeError' (42) 'NameError' (23) 'error' (18) StopIteration def (12) 'ValueErro...

False (845) True (6)

1def node_ignores_exception(
2    node: nodes.NodeNG, exception: type[Exception] | str = Exception
3) -> bool:
4    """Check if the node is in a TryExcept which handles the given exception.
5
6    If the exception is not given, the function is going to look for bare
7    excepts.
8    """
9    managing_handlers = get_exception_handlers(node, exception)
10    if managing_handlers:
11        return True
12    return any(get_contextlib_suppressors(node, exception))
            

Path 2: 26 calls (0.03)

Import (12) Attribute (5) Raise (3) ImportFrom (2) Call (2) Name (1) BinOp (1)

ImportError def (14) AttributeError def (5) 'RuntimeError' (3) StopIteration def (2) NameError def (1) ZeroDivisionError def (1)

True (26)

1def node_ignores_exception(
2    node: nodes.NodeNG, exception: type[Exception] | str = Exception
3) -> bool:
4    """Check if the node is in a TryExcept which handles the given exception.
5
6    If the exception is not given, the function is going to look for bare
7    excepts.
8    """
9    managing_handlers = get_exception_handlers(node, exception)
10    if managing_handlers:
11        return True
12    return any(get_contextlib_suppressors(node, exception))