def fix_attachlist(font):
    """Fix duplicate attachment points in GDEF table."""
    modified = False
    try:
        attach_points = font['GDEF'].table.AttachList.AttachPoint
    except (__HOLE__, AttributeError):
        attach_points = []

    for attach_point in attach_points:
        points = sorted(set(attach_point.PointIndex))
        if points != attach_point.PointIndex:
            attach_point.PointIndex = points
            attach_point.PointCount = len(points)
            modified = True

    if modified:
        print 'Fixed GDEF.AttachList'

    return modified
dataset/ETHPy150Open googlei18n/nototools/nototools/autofix_for_release.py/fix_attachlist