boolean (@NotNull PyClass cls, @NotNull TypeEvalContext context) { if (PyBroadExceptionInspection.equalsException(cls, context)) { return true; } return cls.getAncestorClasses(context) .stream() .anyMatch(baseClass -> PyBroadExceptionInspection.equalsException(baseClass, context)); }