def bytes_to_ints(bs):
    """
    Convert a list of bytes to a list of integers.

    >>> bytes_to_ints([1, 0, 2, 1])
    [256, 513]
    >>> bytes_to_ints([1, 0, 1])
    Traceback (most recent call last):
        ...
    ValueError: Odd number of bytes.
    >>> bytes_to_ints([])
    []
    """
    if len(bs) % 2 != 0:
        raise ValueError("Odd number of bytes.")
    pairs = zip(bs[::2], bs[1::2])
    return [(a << 8) + b for a, b in pairs]