# Buggy code
def _validate_sequence_like(  # noqa: C901 (ignore complexity)
    self, v: Any, values: Dict[str, Any], loc: "LocStr", cls: Optional["ModelOrDc"]
) -> "ValidateReturn":
    """
    Validate sequence-like containers: lists, tuples, sets and generators
    Note that large if-else blocks are necessary to enable Cython
    optimization, which is why we disable the complexity check above.
    """
    if not sequence_like(v):
        e: errors_.PydanticTypeError
        if self.shape == SHAPE_LIST:
            e = errors_.ListError()
        elif self.shape == SHAPE_SET:
            e = errors_.SetError()
        elif self.shape == SHAPE_FROZENSET:
            e = errors_.FrozenSetError()
        else:
            e = errors_.SequenceError()
        return v, ErrorWrapper(e, loc)

    loc = loc if isinstance(loc, tuple) else (loc,)
    result = []
    errors: List[ErrorList] = []
    for i, v_ in enumerate(v):
        v_loc = *loc, i
        r, ee = self._validate_singleton(v_, values, v_loc, cls)
        if ee:
            errors.append(ee)
        else:
            result.append(r)

    if errors:
        return v, errors

    converted: Union[
        List[Any], Set[Any], FrozenSet[Any], Tuple[Any, ...], Iterator[Any], Deque[Any]
    ] = result

    if self.shape == SHAPE_SET:
        converted = set(result)
    elif self.shape == SHAPE_FROZENSET:
        converted = frozenset(result)
    elif self.shape == SHAPE_TUPLE_ELLIPSIS:
        converted = tuple(result)
    elif self.shape == SHAPE_DEQUE:
        converted = deque(result)
    elif self.shape == SHAPE_SEQUENCE:
        if isinstance(v, tuple):
            converted = tuple(result)
        elif isinstance(v, set):
            converted = set(result)
        elif isinstance(v, Generator):
            converted = iter(result)
        elif isinstance(v, deque):
            converted = deque(result)
    return converted, None


# Traceback (TypeError)
Traceback (most recent call last):
File "pydantic/validators.py", line 615, in pydantic.validators.find_validators
TypeError: issubclass() arg 1 must be a class
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "pydantic/dataclasses.py", line 216, in pydantic.dataclasses.dataclass
File "pydantic/dataclasses.py", line 211, in pydantic.dataclasses.dataclass.wrap
File "pydantic/dataclasses.py", line 147, in pydantic.dataclasses._process_class
File "pydantic/main.py", line 925, in pydantic.main.create_model
File "pydantic/main.py", line 262, in pydantic.main.ModelMetaclass.__new__
File "pydantic/fields.py", line 315, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 284, in pydantic.fields.ModelField.__init__
File "pydantic/fields.py", line 362, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 538, in pydantic.fields.ModelField.populate_validators
File "pydantic/validators.py", line 624, in find_validators
RuntimeError: error checking inheritance of typing.Tuple (type: Tuple)

# Fixed code
def _validate_sequence_like(  # noqa: C901 (ignore complexity)
    self, v: Any, values: Dict[str, Any], loc: "LocStr", cls: Optional["ModelOrDc"]
) -> "ValidateReturn":
    """
    Validate sequence-like containers: lists, tuples, sets and generators
    Note that large if-else blocks are necessary to enable Cython
    optimization, which is why we disable the complexity check above.
    """
    if not sequence_like(v):
        e: errors_.PydanticTypeError
        if self.shape == SHAPE_LIST:
            e = errors_.ListError()
        elif self.shape in (SHAPE_TUPLE, SHAPE_TUPLE_ELLIPSIS):
            e = errors_.TupleError()
        elif self.shape == SHAPE_SET:
            e = errors_.SetError()
        elif self.shape == SHAPE_FROZENSET:
            e = errors_.FrozenSetError()
        else:
            e = errors_.SequenceError()
        return v, ErrorWrapper(e, loc)

    loc = loc if isinstance(loc, tuple) else (loc,)
    result = []
    errors: List[ErrorList] = []
    for i, v_ in enumerate(v):
        v_loc = *loc, i
        r, ee = self._validate_singleton(v_, values, v_loc, cls)
        if ee:
            errors.append(ee)
        else:
            result.append(r)

    if errors:
        return v, errors

    converted: Union[
        List[Any], Set[Any], FrozenSet[Any], Tuple[Any, ...], Iterator[Any], Deque[Any]
    ] = result

    if self.shape == SHAPE_SET:
        converted = set(result)
    elif self.shape == SHAPE_FROZENSET:
        converted = frozenset(result)
    elif self.shape == SHAPE_TUPLE_ELLIPSIS:
        converted = tuple(result)
    elif self.shape == SHAPE_DEQUE:
        converted = deque(result)
    elif self.shape == SHAPE_SEQUENCE:
        if isinstance(v, tuple):
            converted = tuple(result)
        elif isinstance(v, set):
            converted = set(result)
        elif isinstance(v, Generator):
            converted = iter(result)
        elif isinstance(v, deque):
            converted = deque(result)
    return converted, None