boolean (@NotNull PyClass cls, @NotNull TypeEvalContext context) { final PyType type = context.getType(cls); return ("Exception".equals(cls.getName()) || "BaseException".equals(cls.getName())) && type != null && type.isBuiltin(); }