import six


def convert_to_text(value):
    """
    Make sure a value is a text type in a Python version generic manner.

    :param value: a value that is either a text or binary string.
    :returns value: a text value.
    """
    if isinstance(value, six.binary_type):
        value = value.decode('utf8')
    if not isinstance(value, six.text_type):
        value = str(value)
    return value