import six


def tuplize(valueName, value):

    """ Make a tuple from 'value'.

    o Use 'valueName' to generate appropriate error messages.
    """
    if isinstance(value, tuple):
        return value
    if isinstance(value, list):
        return tuple(value)
    if isinstance(value, six.string_types):
        return tuple(value.split())
    raise ValueError("%s of unsupported type" % valueName)