import struct


def seq_to_bytes(s):
    """Convert a sequence of integers to a *bytes* instance.  Good for
    plastering over Python 2 / Python 3 cracks.
    """

    fmt = "{0}B".format(len(s))

    return struct.pack(fmt, *s)