def _ll2datum(ll, datum, name):
    """(INTERNAL) Convert datum if needed.
    """
    if datum and ll.datum != datum:
        try:
            ll = ll.convertDatum(datum)
        except AttributeError:
            raise TypeError('no %s.convertDatum: %r' % (name, ll))
    return ll
