def removecommongaps(s1, s2):
    """Remove common gap characters between the two sequences.
    Return s1, s2 with these characters removed.
    """
    if len(s1) != len(s2):
        raise ValueError('Sequences must be same length')
    return (
        ''.join(b1 for b1, b2 in zip(s1, s2) if b1 != '-' or b2 != '-'),
        ''.join(b2 for b1, b2 in zip(s1, s2) if b1 != '-' or b2 != '-'),
    )