def makeBytes(text):
    """Make sure the argument is bytes, converting with UTF-8 encoding
    if it is a string."""
    if isinstance(text, bytes):
        return text
    elif isinstance(text, str):
        return text.encode("utf-8")
    else:
        raise ValueError("Expected str or bytes!")