import re


def _fixup_cc_list(cc_value):
    """Fix up cc list separators and remove duplicates."""
    # Copied from trac.ticket.model
    cclist = []
    for cc in re.split(r'[;,\s]+', cc_value):
        if cc and cc not in cclist:
            cclist.append(cc)
    return ', '.join(cclist)